Createwindowex Error 1400
Contents |
here for a quick overview of the site Help Center Detailed answers to
Createwindowex Getlasterror 1400
any questions you might have Meta Discuss the workings and createwindow error 1400 policies of this site About Us Learn more about Stack Overflow the company Business Learn createwindowex invalid window handle more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why does uninitialised return value cause Invalid Window Handle err in CreateWindowEx? up vote -2 down vote favorite 2 Edit- Added code to do with m_hWndClient and the WndProc that were not originally included. In an attempt to be brief I had incorrectly assumed it was unrelated. After the following is run HWND m_hWndFrame; HWND m_hWndClient; // added in Edit2 ... m_hWndFrame = CreateWindowEx(...) m_hWndFrame is NULL and GetLastError gives "Error 1400 - Invalid Window Handle" but this works fine: HWND m_hWndFrame = NULL; HWND m_hWndClient = NULL; // added in Edit2 ... m_hWndFrame = CreateWindowEx(...) My WndProc looks like this: LRESULT CALLBACK ProgramManager::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { CLIENTCREATESTRUCT clientCreate; HINSTANCE hInstance = GetModuleHandle(NULL); RECT clientRect; switch (uMsg) { case WM_CREATE: clientCreate.hWindowMenu = NULL; clientCreate.idFirstChild = IDM_FIRSTCHILD ; GetClientRect(hwnd,&clientRect); s_instance->m_hWndClient = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT ("MDICLIENT"), NULL, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, clientRect.right, clientRect.bottom, hwnd, (HMENU)ID_MDI_CLIENT, hInstance, (LPVOID)&clientCreate); return 0 ; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; } return DefFrameProc(hwnd,m_hWndClient,uMsg,wParam,lParam); } My project now works (after much hair-tearing) but I don'
topic ForumsMembersHelp Files Developer Journals Gallery Calendar Downloads Resources Store Classifieds Tracker Links Home For Beginners Articles All Articles Post an Article Technical Game Programming General Programming Graphics Programming and Theory DirectX and XNA OpenGL and Vulkan Multiplayer and Network Programming Artificial Intelligence Math and Physics Mobile Development Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design Music and Sound Visual Arts Business Breaking into the Industry Production and Management http://stackoverflow.com/questions/16681303/why-does-uninitialised-return-value-cause-invalid-window-handle-err-in-createwin Interviews Business and Law Event Coverage Forums All Forums Technical Game Programming General Programming Graphics Programming and Theory DirectX and XNA OpenGL & Vulkan Multiplayer and Network Programming Artificial Intelligence Math and Physics Mobile & Console Development Build Systems & Source Control Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design Writing For Games http://www.gamedev.net/topic/586926-createwindow-has-error-1400-invalid-window-handle/ Music and Sound Visual Arts Gallery Business Breaking into the Industry Business & Law Production & Management Community GDNet Lounge Coding Horrors Article Writing Comments, Suggestions and Ideas Your Announcements Hobby Project Classifieds Indie Project Showcase Community Developer Journals GDNet+ Subscriptions Gallery Store Classifieds Jobs Freelancers Hobby Projects Marketplace Newsletter » Home » Forums » The Technical Side » For Beginners Chat Watched Content New Content 0 CreateWindow() has Error 1400 "invalid window handle" Started by VISQI, Nov 05 2010 05:47 AM Old topic! Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic. Pages 1 2 Next You cannot reply to this topic 28 replies to this topic #1 VISQI Members -Reputation: 113 Like 0Likes Like Posted 05 November 2010 - 05:47 AM hey guysi am having a problem with my CreateWindow() function and when i invoked GetLastError(), it r
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project https://www.experts-exchange.com/questions/20833912/CreateWindowEx-returns-error-1400.html Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=17169.0 Exchange > Questions > CreateWindowEx returns error 1400 Want to Advertise Here? Solved CreateWindowEx returns error 1400 Posted on 2003-12-23 MS Development-Other Web Components 1 Verified Solution 6 Comments 2,026 Views error 1400 Last Modified: 2013-12-04 I've looked at MSDN, and the 4 things they say to look at for CreateWindowEx failing as far as I know are false. None of the params are invalid. I highly doubt the system class is registered when I've changed the class to different names (hope I'm understanding that one right). I'm not sure if the 3rd one is true createwindowex error 1400 or not, this is a plugin for AstonShell, but then I look at another plugin I've made with the EXACT same code for CreateWindowEx and only this one errors. And then WM_CREATE and NCCREATE are handled by DefWindowProc. Are there any other things that can cause CreateWindowEx to return NULL? I've tried everything. If anyone wants to see the code, then I'll paste it. 0 Question by:Veratil Facebook Twitter LinkedIn Google LVL 48 Best Solution byAlexFM Open 0-points question in Commity support area: http://www.experts-exchange.com/Community_Support/ Provide link to this question and ask to refund your points. If you want to give me part of points, Go to Solution 5 Comments LVL 48 Overall: Level 48 MS Development-Other 12 Web Components 3 Message Expert Comment by:AlexFM2003-12-23 Please show your code. Do you mean that GetLastError is 1400? This is "Invalid window handle". Possibly HWND hWndParent parameter is wrong. 0 Message Author Comment by:Veratil2003-12-23 void WINAPI InitGlobalModule(const PAstonData AstonData) { WNDCLASS WindowClass; if (AstonData->cbsize < sizeof(TAstonData)) return; RtlMoveMemory(&AData, AstonData, sizeof(TAstonData)); RtlZeroMemory(&WindowClass, sizeof(WNDCLASS)); WindowClass.style = CS_HREDRAW | CS_VREDRAW; WindowClass.hCur
Links and Website Archived Old Forum Files Links for VC and MASM 128553 Posts in 15254 Topics by 684 Members Latest Member: mottt The MASM Forum Archive 2004 to 2012 General Forums The Campus child win creation in a MDI fails using CreateWindowEx « previous next » Pages: [1] 2 3 ... 5 Author Topic: child win creation in a MDI fails using CreateWindowEx (Read 12267 times) Rainstorm Member Gender: Posts: 519 child win creation in a MDI fails using CreateWindowEx « on: August 03, 2011, 11:31:05 PM » Hi,Am trying to create a child window in a MDI using CreateWindowEx but i get a '1400' error 'invalid window handle'.The handle supplied to the child window is the client win handle, & I've tested the return on the clientwindow & it seems to return a valid handlethe code displays the client win handle & the error code after the childwin creation callThanks.~ Mdi.zip (8.7 KB - downloaded 109 times.) Logged dedndave Member Posts: 12523 Re: child win creation in a MDI fails using CreateWindowEx « Reply #1 on: August 04, 2011, 12:24:05 AM » http://msdn.microsoft.com/en-us/library/ms644923%28v=vs.85%29.aspxi think the problem may be related to using MDIS_ALLCHILDSTYLES with CreateWindowExyou should be able to create it with CreateWindowExbut, you have to thoroughly review the docs for WNDCLASSEX and CreateWindowEx you may be missing a flag somewhere Logged dedndave Member Posts: 12523 Re: child win creation in a MDI fails using CreateWindowEx « Reply #2 on: August 04, 2011, 12:49:59 AM » if you google around a bit, you can find a zip called "xxControls"lots of cool stuff in therethey have an example of an MDI...main windowCode: invoke CreateWindowEx, NULL, ADDR szClassMain, ADDR szDisplayName, WS_OVERLAPPEDWINDOW or WS_CLIPCHILDREN, CW_USEDEFAULT,0,CW_USEDEFAULT,0, NULL,hMenu, hInstance,NULLchild...Code: invoke CreateWindowEx,WS_EX_CLIENTEDGE, ADDR szClassMDI,NULL, WS_CHILD or WS_CLIPCHILDREN or WS_VISIBLE, 0, 0, 0, 0, hWin,0,