|
-
September 7th, 2004, 09:08 AM
#1
changing the icon of a window
hi gurus
I try to make an exe to change the icon of a window of an other application.
here my code :
#include "stdafx.h"
#include <winbase.h>
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
HWND hWnd;
HICON hIcon;
// AUDROS (5.5) is the title of the window of I want to change the icon
hWnd = FindWindow(NULL, "AUDROS (5.5)");
if (hWnd)
{
hIcon = (HICON)LoadImage(NULL, "ico00001.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall);
}
return(0);
}
It change the icon but as soon as the window is activate, my icon is replace with a defaut one !!!!
any help ?
thanks
chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|