Ok. I made some changes, just to get the window to show up right. The changes i made caused the window to show up, but now it wont move, minimize, or close for me w/ the DefWindowProc as it should:
Code:
#include <windows.h>
#include <winsock.h>
#include <process.h>
#include <shellapi.h>
#include <commctrl.h>
#include <stdio.h>
#include <string.h>
#include "resource.h"
#define Alert(x) MessageBox(NULL, x, "Alert:", MB_OK);
//#define ID_TASKICON 1010
//structures
struct THREADOPCTRL
{
bool operate;
bool operating;
};
//global variables
NOTIFYICONDATA tray_icon;
OPENFILENAME set_file;
bool error_log = false, client_info = false;
THREADOPCTRL serv_ctrl;
//function declarations
void FlipState (bool&);
//window procedures
BOOL CALLBACK SettingsWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_COMMAND:
break;
case WM_CLOSE:
DestroyWindow (hwnd);
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (hwnd, msg, wParam, lParam);
}
return TRUE;
}
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
HWND SettingsDialog;
MSG msg;
serv_ctrl.operate = true;
serv_ctrl.operating = false;
SettingsDialog = CreateDialog (GetModuleHandle (NULL), MAKEINTRESOURCE (MAIN_DIALOG), NULL, SettingsWindowProc);
while (GetMessage (&msg, NULL, 0, 0))
{
if (!IsDialogMessage (SettingsDialog, &msg))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
return msg.wParam;
}
void FlipState (bool& to_filp)
{
to_filp = !to_filp;
}
well at least the window is solid now...