Try something like this:
SendDlgItemMessage(hWnd, IDC_BUTTON1, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)(HICON)LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON)));
Basically sending the WM_SETICON...
Type: Posts; User: ExDigit
Try something like this:
SendDlgItemMessage(hWnd, IDC_BUTTON1, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)(HICON)LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON)));
Basically sending the WM_SETICON...
Just backing what Okie said:
CMainWnd::CMainWnd()
{
Create(NULL,"Step1",WS_OVERLAPPEDWINDOW,rectDefault,NULL,MAKEINTRESOURCE(IDR_MENU1));
}
Well, the command line that the user sed to execute your program is kept in the LPSTR part (usually lpCmdLne or similar).
Secondly, to display a dialog it is probably easiest to use a resource...
Hello.
I'm trying to make a small program to unhide passwords from asterick-riddled edit boxes. I decided to make it because, well, the other day I admittedly forgot one of my passwords and after...
Is it possible to put an icon next to an item on a pop-up menu, and if so, how? I've seen this done in some programs..
I'm using API, not MFC (and resources aren't a problem).
Thanks,
Chris
Hrm, not long ago I posted "Something for the Newbies" but that might have been scrolled off the first forum page now.
Anyway, try the following:
http://www.winprog.org/ <-- Excellent tutorial...
I figured out how to use it the other day from some example source code, I really should have said so, sorry. Thanks for the example anyway, it's made things even more clear to me.
Thanks,
Chris...
A Win32 C programming forum isn't really the place for this, but I'll answer anyway.
Download Sygate Personal Firewall from http://www.sygate.com or http://www.download.com
Once you have it,...
Oops, about 1 minute after I posted I decided to try:
ExitWindowsEx(EWX_SHUTDOWN | EWX_POWEROFF, 0);
Works now. This means I made my first useful Windows utility.. it should be available on my...
For some reason, using:
ExitWindowsEx(EWX_SHUTDOWN, 0);
Only logs off of Windows; it doesn't shut it down like the API reference says. Can anyone help me shut down Windows further than logging...
Hello,
I'm thinking about making a small utility, however I need to know how to place an icon in the system tray. Also, how can I catch clicks on the icon.
Any tutorials or sample source code would...
If you're familiar with C/C++ then go for Visual C++.. if you would like a nice easy task, use Visual Basic. Visual Basic is far easier to use than C/C++.. so it depends on what you know and how easy...
I just thought I'd put this post up for any newbies who want to start programming in Windows with C/C++.
I have just finished writing a quick tutorial on writing your first application using...
If you're looking for a free C/C++ compiler, download Dev-C++. Well, really Dev-C++ is the IDE, but compiles in either Cygwin or Ming32 (you can choose from the Compiler Options). The resource editor...
You can download the Win32 API Reference from:
http://www.winprog.org/resources.html
Which I think is the same file that you are looking for. :)
We figured something similar out later on in the forums, but just to make your question complete:
#include <windows.h>
#include <stdio.h>
int main()
{
char HistoryFolder[301];
DWORD...
Just incase you're still stuck.. uhm.. I doubt you are..
Width = Rect.right - Rect.left;
Height = Rect.bottom - Rect.top
But that's obvious..:(
Well I just made a really quick Visual Basic app that acts as a server on port 110 and another app to connect to it and it seemed to work.
I noticed you run a server which offers e-mail.. perhaps...
As an addition to these.. this is what the RECT structure is:
Good luck. :)
:) Hehe, I got it working! I looked in the Win32 API Reference and it said that the first DWORD must be the type of data.. Seeing as we want to receive a zero terminated string, I used REG_SZ. And...
Yeah, I have that registry entry and it contains data.. (Windows ME)
Okay, I changed the main function into a WinMain function, but now it displays a message box full of garbage. This is the code:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance,...
Oh, yeah I realised that, but it just displays an empty message box for me.. does it work on your box? :confused:
Hmm, that code doesn't seem to work Sorensen. :(
How is it possible to search for a window with a given titlebar for example and return its handle. A bit like VisualBasic's AppActivate, but once the window is found, a handle is returned..
Thanks.