Trying to hide all windows of msn

This is a discussion on Trying to hide all windows of msn within the Windows Programming forums, part of the Platform Specific Boards category; Hey guys today i was looking EnumWindows function in msdn so i decided i wanna write a window hider for ...

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    187

    Trying to hide all windows of msn

    Hey guys today i was looking EnumWindows function in msdn so i decided i wanna write a window hider for msn but i dont rlly get the picture of it it get a EnumWindowsProc for it but i dunno why my program fails :S
    Code:
    #include <stdio.h>
    #include <windows.h>
    BOOL CALLBACK Procedure(HWND child,LPARAM lParam)
    {
    	char WindowChildClass[]="DirectUIHWND";
    	HWND Parent;
    	Parent=FindWindow(NULL,"Windows Live Messenger");
    	child=FindWindowEx(Parent,0,WindowChildClass,0);
    	ShowWindow(child,SW_HIDE);
    	return TRUE;
    }
    void hide_it()
    {
    	EnumWindows(Procedure,0);
    }
    int main(void)
    {
    	hide_it();
    	return 0;
    }

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    187
    i made it work but what i dont understand in this EnumWindowsProc that it takes a hwnd and lparmeter and shouldnt we get the hwnd of the parent window or the function does that already for us ?
    Code:
    #include <stdio.h>
    #include <windows.h>
    char MSN_CLASSNAME[] = "IMWindowClass";
    char MSN_CHILDCLASS[] = "DirectUIHWND";
    BOOL CALLBACK Hide_it(HWND hwnd,LPARAM lParam)
    {
    	HWND child;
    	child = FindWindowEx(hwnd,0, MSN_CHILDCLASS,0);
    	ShowWindow(child,SW_HIDE);
    	return TRUE;
    }
    void hide_it()
    {
    	EnumWindows(Hide_it,0);
    }
    int main(void)
    {
    	hide_it();
    	return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to Hide Cursor in one of the Splitter Windows?
    By kevin_cat in forum Windows Programming
    Replies: 1
    Last Post: 06-24-2005, 01:57 PM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21