Since I didn't want to use MFC after reading all the tutorials on here for minimizing an application to the system tray, I did some research and made it so my program has a tray icon. Now, my only problem is, how do you detect when a window's minimize button is pressed in Win32? I've scoured MSDN and asked on a few forums, but nobody seems to be willing to give a direct answer.
The debugger doesn't seem to want to work. I might have to try a different IDE and see if it will make the compiler build the file with debugging info. When trying to get the debugger to work, this warning started to come up and it is now coming up all the time when I build my project.
<quote>Project : Win32 Application
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\John\Desktop\derp\
Switching to target: default
main.cpp: In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)':
main.cpp:57: warning: passing NULL used for non-pointer converting 1 of `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
Linking executable: C:\Documents and Settings\John\Desktop\derp\Win32GUI.exe
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 1 warnings
This is the code it is pointing to:
hWnd = CreateWindowEx(NULL,<br />
"WindowClass1", // name of the window class<br />"Our First Windowed Program", // title of the window<br />
WS_OVERLAPPEDWINDOW, // window style<br />300, // x-position of the window<br />300, // y-position of the window<br />500, // width of the window<br />400, // height of the window<br />
NULL, // we have no parent window, NULL<br />
NULL, // we aren't using menus, NULL<br />
hInstance, // application handle<br />
NULL); // used with multiple windows, NULL
The last NULL in the list is the line the compiler points to. Could this warning have an affect on the program not detecting when I click the icon?
If the compiler says "undeclared identifier" it means it can't find it. There are two possibilities:
1. A missing header file.
2. The identifies name is wrong or it's in a namespace and you haven't qualified the name with it or put in a using statement to import it.
Knock number two on the head by adding no_namespace after the #import. i.e.
When the component is authored the interface is probably described in an IDL or ODL file. If so, when it is compiled with MIDL a type library and some C++ header files are produced. If these files are distributed you can use these for C++.
If the interfaces are IDispatch based you could use the library without any type information, but this hard to describe and not the best approach in C++ anyway.