I'm trying to create a simple program that when executed will place an icon in the system tray and whenever I double clicked the icon a dialog would appear. I have no idea how to do it so could someone edit the files below to do this. (resource.h/resource.rc/main.c)
resource.h
Code:
#define IDD_MAIN 101
#define IDC_OK 102
resource.rc
Code:
#include <windows.h>
#include "resource.h"
IDD_MAIN DIALOG DISCARDABLE 0, 0, 150, 60
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "DIALOG"
FONT 8, "MS Sans Serif"
BEGIN
CTEXT "CONTENT",IDC_STATIC,5,12,145,20
DEFPUSHBUTTON "&OK",IDC_OK,48,43,50,15
END
main.c
Code:
#include <windows.h>
#include "resource.h"
BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_CLOSE:
EndDialog(hwnd, IDC_OK);
break;
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_OK:
EndDialog(hwnd, IDC_OK);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDlgProc);
}