wfreerdp: fix icon
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Tue, 19 Mar 2013 15:11:14 +0000 (11:11 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Tue, 19 Mar 2013 15:11:14 +0000 (11:11 -0400)
.gitignore
client/Windows/CMakeLists.txt
client/Windows/FreeRDP.ico [new file with mode: 0644]
client/Windows/cli/CMakeLists.txt
client/Windows/cli/wfreerdp.c
client/Windows/resource.h [new file with mode: 0644]
client/Windows/wf_interface.c
client/Windows/wfreerdp.aps [new file with mode: 0644]
client/Windows/wfreerdp.rc [new file with mode: 0644]

index 2b72aa9..e82f262 100644 (file)
@@ -53,6 +53,7 @@ DerivedData/
 *.suo
 *.ncb
 *.opensdf
+Thumbs.db
 ipch
 Debug
 RelWithDebInfo
index 4309859..c006d1b 100644 (file)
@@ -32,7 +32,9 @@ set(${MODULE_PREFIX}_SRCS
        wf_rail.c
        wf_rail.h
        wf_interface.c
-       wf_interface.h)
+       wf_interface.h
+       wfreerdp.rc
+       resource.h)
 
 if(WITH_CLIENT_INTERFACE)
        add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
diff --git a/client/Windows/FreeRDP.ico b/client/Windows/FreeRDP.ico
new file mode 100644 (file)
index 0000000..0864d1c
Binary files /dev/null and b/client/Windows/FreeRDP.ico differ
index 56e4928..7a04372 100644 (file)
@@ -22,7 +22,8 @@ include_directories(..)
 
 set(${MODULE_PREFIX}_SRCS
        wfreerdp.c
-       wfreerdp.h)
+       wfreerdp.h
+       ../wfreerdp.rc)
 
 add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS})
 
index a625a86..19a2b24 100644 (file)
@@ -38,6 +38,8 @@
 #include <freerdp/client/channels.h>
 #include <freerdp/channels/channels.h>
 
+#include "resource.h"
+
 #include "wf_interface.h"
 
 INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
diff --git a/client/Windows/resource.h b/client/Windows/resource.h
new file mode 100644 (file)
index 0000000..5ee440f
--- /dev/null
@@ -0,0 +1,2 @@
+
+#define IDI_ICON1      101
index 5a9695d..71b2fdb 100644 (file)
@@ -55,6 +55,8 @@
 
 #include "wf_interface.h"
 
+#include "resource.h"
+
 void wf_context_new(freerdp* instance, rdpContext* context)
 {
        wfInfo* wfi;
@@ -187,6 +189,7 @@ void wf_hw_desktop_resize(rdpContext* context)
                if (same)
                        wfi->drawing = wfi->primary;
        }
+
        if (wfi->fullscreen != TRUE)
        {
                if (wfi->hwnd)
@@ -517,7 +520,7 @@ BOOL wf_check_fds(freerdp* instance)
        return TRUE;
 }
 
-int wfreerdp_run(freerdp* instance)
+DWORD WINAPI wf_thread(LPVOID lpParam)
 {
        MSG msg;
        int index;
@@ -529,8 +532,11 @@ int wfreerdp_run(freerdp* instance)
        void* wfds[32];
        int fds_count;
        HANDLE fds[64];
+       freerdp* instance;
        rdpChannels* channels;
 
+       instance = (freerdp*) lpParam;
+
        ZeroMemory(rfds, sizeof(rfds));
        ZeroMemory(wfds, sizeof(wfds));
 
@@ -634,18 +640,6 @@ int wfreerdp_run(freerdp* instance)
        return 0;
 }
 
-DWORD WINAPI wf_thread(LPVOID lpParam)
-{
-       wfInfo* wfi;
-       freerdp* instance;
-
-       instance = (freerdp*) lpParam;
-
-       wfreerdp_run(instance);
-
-       return (DWORD) NULL;
-}
-
 DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
 {
        MSG msg;
@@ -721,6 +715,9 @@ wfInfo* wf_new(HINSTANCE hInstance, int argc, char** argv)
        wfInfo* wfi;
        freerdp* instance;
 
+       if (!hInstance)
+               hInstance = GetModuleHandle(NULL);
+
        instance = freerdp_new();
        instance->PreConnect = wf_pre_connect;
        instance->PostConnect = wf_post_connect;
@@ -741,7 +738,7 @@ wfInfo* wf_new(HINSTANCE hInstance, int argc, char** argv)
 
        wfi->hInstance = hInstance;
        wfi->cursor = LoadCursor(NULL, IDC_ARROW);
-       wfi->icon = LoadIcon(NULL, IDI_APPLICATION);
+       wfi->icon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1));
        wfi->wndClassName = _tcsdup(_T("FreeRDP"));
 
        wfi->wndClass.cbSize = sizeof(WNDCLASSEX);
@@ -749,12 +746,12 @@ wfInfo* wf_new(HINSTANCE hInstance, int argc, char** argv)
        wfi->wndClass.lpfnWndProc = wf_event_proc;
        wfi->wndClass.cbClsExtra = 0;
        wfi->wndClass.cbWndExtra = 0;
-       wfi->wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
        wfi->wndClass.hCursor = wfi->cursor;
        wfi->wndClass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
        wfi->wndClass.lpszMenuName = NULL;
        wfi->wndClass.lpszClassName = wfi->wndClassName;
        wfi->wndClass.hInstance = hInstance;
+       wfi->wndClass.hIcon = wfi->icon;
        wfi->wndClass.hIconSm = wfi->icon;
        RegisterClassEx(&(wfi->wndClass));
 
diff --git a/client/Windows/wfreerdp.aps b/client/Windows/wfreerdp.aps
new file mode 100644 (file)
index 0000000..1edfc0f
Binary files /dev/null and b/client/Windows/wfreerdp.aps differ
diff --git a/client/Windows/wfreerdp.rc b/client/Windows/wfreerdp.rc
new file mode 100644 (file)
index 0000000..ef912b2
Binary files /dev/null and b/client/Windows/wfreerdp.rc differ