I've been creating windows in c++(much fun), however, I haven't been able to customize it very well. How can I make the window not resizable? Only having a minimize and close buttons in the title bar? Much thanks for any help
This is a discussion on Windows within the Windows Programming forums, part of the Platform Specific Boards category; I've been creating windows in c++(much fun), however, I haven't been able to customize it very well. How can I ...
I've been creating windows in c++(much fun), however, I haven't been able to customize it very well. How can I make the window not resizable? Only having a minimize and close buttons in the title bar? Much thanks for any help
I wanted to do this before, and I found out how. Whereyou created the main window, do this:
hwnd=CreateWindowEx(
0,
szClassName,
"Title",
WS_OVERLAPPED | WS_MINIMIZEBUTTON,
CW_USEDEFAULT | CW_USEDEFAULT,
544,
375,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
Website(s): http://www16.brinkster.com/trifaze/
E-mail: trifaze_mattu@lycos.com
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
I just tried that code you provided SyntaxBubble and I got errors saying that there were "a wrong number" of auguments in the CreateWindow and it says that WS_MINIMIZEBOX is un-declared"
am I doing something wrong or is it a problem with your code?
Thanks, I ended up finding that out before I read your post. Now I need some help with the API function TextOut. I'm trying to make a function(s) to draw text on the window(also more to remove the text and get the text). I can't get TextOut to work right. Here's the code for my function:
It isn't printing anything to the board when I use:Code:struct Label { long XPos; long YPos; char Caption[255]; long TxtLength; HDC hDC; }; void CreateLabel(long XPos,long YPos,char Caption[255],HDC hDC,RECT aRect) { strcpy(lTextLabel[TextLabelCount].Caption,Caption); lTextLabel[TextLabelCount].TxtLength=sizeof(Caption); lTextLabel[TextLabelCount].XPos=XPos; lTextLabel[TextLabelCount].YPos=YPos; lTextLabel[TextLabelCount].hDC=hDC; SetBkMode(lTextLabel[TextLabelCount].hDC, TRANSPARENT); BeginPath(lTextLabel[TextLabelCount].hDC); TextOut(hDC,aRect.top,aRect.left,"sweet",5); //TextOut(lTextLabel[TextLabelCount].hDC,lTextLabel[TextLabelCount].XPos,lTextLabel[TextLabelCount].YPos,(char *)lTextLabel[TextLabelCount].Caption,lTextLabel[TextLabelCount].TxtLength); EndPath(lTextLabel[TextLabelCount].hDC); TextLabelCount++; }
CreateLabel(50,50,"mytext",hDC,aRect);
I've already checked out MSDN but It doesn't help too much. Anyone have experience with this function?