diff options
author | Eion Robb <eion@robbmob.com> | 2007-11-06 12:20:33 +0300 |
---|---|---|
committer | Eion Robb <eion@robbmob.com> | 2007-11-06 12:20:33 +0300 |
commit | a5b987bde3acc9c36ac029d490728c0c9e1d1103 (patch) | |
tree | e2cb5dd05d0070dd39d370847ffc8147975e5d86 /skype_messaging_win32.c | |
parent | 5299e970cf2e81f85b6f0961103927ec7813a41e (diff) |
Handle error messages without segfaulting better (mainly used while shutting down pidgin)
Diffstat (limited to 'skype_messaging_win32.c')
-rw-r--r-- | skype_messaging_win32.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/skype_messaging_win32.c b/skype_messaging_win32.c index 38d8e56..429457f 100644 --- a/skype_messaging_win32.c +++ b/skype_messaging_win32.c @@ -14,7 +14,7 @@ static HWND hInit_MainWindowHandle = NULL; static HWND hGlobal_SkypeAPIWindowHandle = NULL;
HANDLE hEvent = NULL;
-static gboolean +static gboolean
skype_connect()
{
int i = 0;
@@ -35,20 +35,20 @@ skype_connect() purple_debug_info("skype_win32", "Sending broadcast message\n");
SendMessage( HWND_BROADCAST, uiGlobal_MsgID_SkypeControlAPIDiscover, (WPARAM)hInit_MainWindowHandle, 0);
purple_debug_info("skype_win32", "Broadcast message sent\n");
- +
while(hGlobal_SkypeAPIWindowHandle == NULL && i < 100)
- { + {
i++;
Sleep(10);
- } - - if (hGlobal_SkypeAPIWindowHandle == NULL) + }
+
+ if (hGlobal_SkypeAPIWindowHandle == NULL)
return FALSE;
return TRUE;
}
-static void +static void
win32_message_loop()
{
MSG msg;
@@ -66,8 +66,8 @@ win32_message_loop() oWindowClass.lpszMenuName = NULL;
oWindowClass.lpszClassName = SKYPE_WIN32_CLASS_NAME;
classRegistration = RegisterClass(&oWindowClass);
- hInit_MainWindowHandle = CreateWindow(SKYPE_WIN32_CLASS_NAME, SKYPE_WIN32_CLASS_NAME, - WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, + hInit_MainWindowHandle = CreateWindow(SKYPE_WIN32_CLASS_NAME, SKYPE_WIN32_CLASS_NAME,
+ WS_OVERLAPPEDWINDOW, 0, 0, 0, 0,
NULL, NULL, hInit_ProcessHandle, NULL);
ShowWindow(hInit_MainWindowHandle, SW_HIDE);
@@ -79,28 +79,28 @@ win32_message_loop() }
}
-static void +static void
skype_disconnect()
{
UnregisterClass(SKYPE_WIN32_CLASS_NAME, hInit_ProcessHandle);
CloseHandle(hInit_ProcessHandle);
- DestroyWindow(hInit_MainWindowHandle); - hInit_ProcessHandle = NULL; + DestroyWindow(hInit_MainWindowHandle);
+ hInit_ProcessHandle = NULL;
hInit_MainWindowHandle = NULL;
}
-static void +static void
send_message(char* message)
{
int message_num;
- char *error_return;
+ char error_return[15];
COPYDATASTRUCT oCopyData;
oCopyData.dwData = 0;
oCopyData.lpData = (void *)message;
oCopyData.cbData = strlen(message) + 1;
- if (SendMessage( hGlobal_SkypeAPIWindowHandle, WM_COPYDATA, + if (SendMessage( hGlobal_SkypeAPIWindowHandle, WM_COPYDATA,
(WPARAM)hInit_MainWindowHandle, (LPARAM)&oCopyData) == FALSE)
{
//There was an error
@@ -114,7 +114,7 @@ send_message(char* message) }
}
-static LRESULT CALLBACK +static LRESULT CALLBACK
Skype_WindowProc(HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam)
{
|