diff --git a/.gitignore b/.gitignore index 2b72aa942..e82f26244 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ DerivedData/ *.suo *.ncb *.opensdf +Thumbs.db ipch Debug RelWithDebInfo diff --git a/client/Windows/CMakeLists.txt b/client/Windows/CMakeLists.txt index 43098594a..c006d1b00 100644 --- a/client/Windows/CMakeLists.txt +++ b/client/Windows/CMakeLists.txt @@ -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 index 000000000..0864d1cda Binary files /dev/null and b/client/Windows/FreeRDP.ico differ diff --git a/client/Windows/cli/CMakeLists.txt b/client/Windows/cli/CMakeLists.txt index 56e492853..7a0437279 100644 --- a/client/Windows/cli/CMakeLists.txt +++ b/client/Windows/cli/CMakeLists.txt @@ -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}) diff --git a/client/Windows/cli/wfreerdp.c b/client/Windows/cli/wfreerdp.c index a625a860b..19a2b2412 100644 --- a/client/Windows/cli/wfreerdp.c +++ b/client/Windows/cli/wfreerdp.c @@ -38,6 +38,8 @@ #include #include +#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 index 000000000..5ee440fa5 --- /dev/null +++ b/client/Windows/resource.h @@ -0,0 +1,2 @@ + +#define IDI_ICON1 101 diff --git a/client/Windows/wf_interface.c b/client/Windows/wf_interface.c index 5a9695d4b..71b2fdb94 100644 --- a/client/Windows/wf_interface.c +++ b/client/Windows/wf_interface.c @@ -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 index 000000000..1edfc0fc3 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 index 000000000..ef912b2d7 Binary files /dev/null and b/client/Windows/wfreerdp.rc differ