Thread: resource script

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    64

    resource script

    is it possible to write a resource script in visual c++, without using the wizards for dialog boxes and such, everytime i open a new resource script i am not able to write anything, just use the templates but i want to learn to write them with code for myself.

    How can i do this?

    Thanks for your help

  2. #2
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    522
    Big subject, a book will be explain this better than I can.
    Code:
    MyMenu MENU
    {
       POPUP "File"
       {
          MENUITEM "Open", IDM_OPEN
       }
       MENUITEM "Help", IDM_HELP
    }
    This is code for a menu, the keyword MENU is what informs the compiler its a menu and MyMenu is the menu name.
    A POPUP means that the specified name, in this case file, is a submenu. A MENUITEM is an item the user can select.
    The IDM_OPEN & IDM_HELP are the messages windows sends when the corresponding MENUITEM is clicked and you need to define them for example:
    #define IDM_OPEN 1000
    #define IDM_HELP 1001
    You should save the file with a .rc extension, msvc will produce the resource file from that.
    A dialog is harder create this way as you need to specify the size of buttons and the position of buttons, which is far easier visually.
    Anyway a dialog goes like this:
    Code:
    MyDB DIALOGEX 10, 10, 210, 110
    CAPTION "My Dialog Box"
    STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_BORDER
    {
       DEFPUSHBUTTON "Button1", IDD_BUTTON1, 11, 10, 36, 14
       PUSHBUTTON    "Button2", IDD_BUTTON2, 11, 34, 36, 14
    }
    A bit more going on here, the keywords should be fairly obvious as to what they do.
    As far as the numbers go the first 2 for each item are the position and the second 2 are the size.
    You really need to find a book with this in though.
    Last edited by C_Coder; 03-08-2002 at 03:10 PM.
    All spelling mistakes, syntatical errors and stupid comments are intentional.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Resource Script Problem
    By ltanusaputra in forum Windows Programming
    Replies: 2
    Last Post: 06-02-2007, 09:08 AM
  2. qn on Microsoft Developer Studio generated resource script
    By Raison in forum Windows Programming
    Replies: 2
    Last Post: 05-29-2004, 11:49 AM
  3. Win32 Resource Script Generator
    By punkrockguy318 in forum C++ Programming
    Replies: 6
    Last Post: 01-02-2004, 11:35 PM
  4. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 01:47 PM
  5. wtf is wrong with this resource script!
    By DarkViper in forum Windows Programming
    Replies: 1
    Last Post: 12-06-2002, 08:14 PM