Thread: Windows

  1. #1
    Neandrake
    Guest

    Windows

    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

  2. #2
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Cool This works...

    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: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    202
    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?

  4. #4
    Neandrake
    Guest
    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:
    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++;
    }
    It isn't printing anything to the board when I use:

    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?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows 98/2000 programming in Windows XP
    By Bill83 in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:16 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