Win32 Question: Create Function Window

Q: I try to add a child window of a generic top-level window in my application. Ive written the window class of the highest-level window. The window Im trying to make is the window class type Console Window Class 0.

Im using the following call to the child console

hConsole = CreateObject Window (_T making (“Console Window Class”), _T (“Console”), WS_CHILD , 5, 5, CW_USEDEFAULT, CW_USEDEFAULT, hWnd, NULL, hInst, NULL);

I thought it would, but I get is a console window wrapper class is not included in my window. This means that the console window is another top-level overlapped window.

Being a noob at this stuff sucks. As such, any help would be appreciated.


Re:Look into GetWindowLong/SetWindowLong. If I remember correctly, you can use these to get/set attributes of a window at runtime. Unfortunately, I don't remember all the details. Something about GWL_STYLE, though.

Re:That made sense… I played around some more till I realized (correctly?) that "ConsoleWindowClass" is not a system global window class. Previously, I was using AllocConsole() to get a handle to the class, and in reviewing my code I had skipped that.

Basically, now that I have a window that I cannot directly create using CreateWindow, is there any way at run time I can strip away its border, title bar, system menu, and min/max boxes?

I checked MSDN and found many Console IO functions are exported by kernel32.lib / wincon.h. I checked all the exports, but I could not find any particular window class there.


Re:The Window style allow a window to be created without a Caption.

Look at the dwStyle section in the CreateWindowEx API.


Re:I thought a window would be created without a title bar and min/max boxes by specifying it as WS_CHILD and then providing a HWND for the parent to CreateWindow? I guess I'm missing something blatant… so I'll ask: How do you create a window without any title bar?

TIA


Re:I have used the brute force method before. Someone else may jump in with a clean method.

I would create the window without any title bar and position it within the parent window. When the parent window received messages relating to movement, I would then move the child window accordingly.


Related posts

Leave a comment

0 Comments.

Leave a Reply


click to changeSecurity Code

[ Ctrl + Enter ]