SwitchToThisWindow c++

Hi, ich habe so ein Spaßprogramm geschrieben, um mir alle möglichen Windows-Funktionen besser zu merken, funktioniert ja auch ganz gut, bis ich die Funktion
SwitchToThisWindow(hwndSavedWindow,false);
hinzugefügt habe.
Da sagt er mir nämlich das er diese Funktion nicht finden kann, habe aber windows.h und sogar winuser.h includiert, hier mal mein Code, die Funktion wird so ziemlich am Ende benutzt:
Code:
#include<windows.h>
#include<winuser.h>

LRESULT CALLBACK MainProcess(HWND hwndThisWindow,UINT message,WPARAM wparam,LPARAM lparam);

HWND hwndSavedWindow;
bool bWindowSaved=false;

int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR szCmdLine,
int iCmdShow)
{
	  WNDCLASSEX WCla;
	  HWND hwndMain;
	  MSG msg;
	  const char* szAppName="FunktionsProgramm";
	  
	  WCla.style=CS_HREDRAW|CS_VREDRAW;
			WCla.cbSize=sizeof(WNDCLASSEX);
			WCla.cbClsExtra=0;
			WCla.cbWndExtra=0;
	  WCla.lpfnWndProc=MainProcess;
	  WCla.lpszClassName=szAppName;
			WCla.lpszMenuName=0;
			WCla.hInstance=hInstance;
			WCla.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
			WCla.hCursor=LoadCursor(0,IDC_ARROW);
			WCla.hIcon=LoadIcon(0,IDI_APPLICATION);
			WCla.hIconSm=LoadIcon(0,IDI_APPLICATION);
			
			RegisterClassEx(&WCla);
			hwndMain=CreateWindowEx(0,szAppName,"Funktionen",WS_OVERLAPPEDWINDOW,0,0,
			300,150,
			0,0,hInstance,0);
			
			
			ShowWindow(hwndMain,iCmdShow);
			UpdateWindow(hwndMain);
	  
	  while(GetMessage(&msg,0,0,0)>0)
	  {
				  TranslateMessage(&msg);
				  DispatchMessage(&msg);
			}
			
			return 0;
}
LRESULT CALLBACK MainProcess(HWND hwndThisWindow,UINT message,WPARAM wparam,LPARAM lparam)
{
	  switch(message)
	  {
						case WM_PAINT:
											HDC hdc;
											PAINTSTRUCT ps;
											hdc=BeginPaint(hwndThisWindow,&ps);
											{
												  TextOut(hdc,0,0,"1: Speicher das Fenster ganz oben links",
														sizeof("1: Speicher das Fenster ganz oben links"));
														TextOut(hdc,0,20,"2: Zeichne das gespeicherte Fenster neu",
														sizeof("2: Zeichne das gespeicherte Fenster neu"));
														TextOut(hdc,0,40,"3: Minimiere das gespeicherte Fenster",
														sizeof("3: Minimiere das gespeicherte Fenster"));
														TextOut(hdc,0,60,"4: Bewege das gespeicherte Fenster",
														sizeof("4: Bewege das gespeicherte Fenster"));
														TextOut(hdc,0,60,"4: Aktiviere das gespeicherte Fenster",
														sizeof("4: Aktiviere das gespeicherte Fenster"));
											}
											EndPaint(hwndThisWindow,&ps);
											return 0;
						case WM_KEYUP:
											switch(wparam)
											{
												  case 13:
																			SendMessage(hwndThisWindow,WM_CLOSE,0,0);
																			return 0;
														case 27:
																			SetTimer(hwndThisWindow,1,1000,0);
																			return 0;
														case 49:
																			POINT pointGetWindow;
																			pointGetWindow.x=0;
																			pointGetWindow.y=0;
																			hwndSavedWindow=WindowFromPoint(pointGetWindow);
																			bWindowSaved=true;
																			return 0;
														case 50:
																			if(bWindowSaved)InvalidateRect(hwndSavedWindow,0,true);
																			return 0;
														case 51:
																			if(bWindowSaved)CloseWindow(hwndSavedWindow);
																			return 0;
														case 52:
																			if(bWindowSaved)MoveWindow(hwndSavedWindow,0,0,300,150,true);
																			return 0;
														case 53:
																			if(bWindowSaved)SwitchToThisWindow(hwndSavedWindow,false);
																			return 0;
											}
						case WM_TIMER:
											
											return 0;
						case WM_CLOSE:
											DestroyWindow(hwndThisWindow);
											return 0;
						case WM_DESTROY:
											PostQuitMessage(0);
											return 0;
			}
			return DefWindowProc(hwndThisWindow,message,wparam,lparam);
}
Danke im Vorraus
 
google & msdn sind da die ersten ansprechpartner.

Remarks
This function is typically called to maintain window z-ordering.
Although you can access this function by using LoadLibrary and GetProcAddress combined in Microsoft Windows versions prior to Windows XP, the function is not accessible using the standard Include file and library linkage. The header files included in Windows XP Service Pack 1 (SP1) and Windows Server 2003 document this function and make it accessible using the appropriate Include file and library linkage. However, this function is deprecated and not intended for general use. It is recommended that you do not use it in new programs because it might be altered or unavailable in subsequent versions of Windows.

auf gut deutsch, du musst die function per loadlibrary und getprocaddress rausfischen und sie callen
 
the function is not accessible using the standard Include file and library linkage. The header files included in Windows XP Service Pack 1 (SP1) and Windows Server 2003 document this function and make it accessible using the appropriate Include file and library linkage. However, this function is deprecated and not intended for general use.

das ist eigentlich das wichtige...

sagt soviel wie: ( vorm ausschnit ) Du kannst diese Funktion zwar durch loadlibary und getprocadress erreichen sie ist aber nicht zur verwendung gedacht da.. bla bla bla..

übrigens, fix doch mal deine einrückungen.. die sind schreklich.. und englisch ist essentiel :D


good luck
 
Zurück
Oben