C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-19-2008, 02:05 PM   #1
Registered User
 
Join Date: Jul 2008
Posts: 56
WIN32 API Controls used with Resource

I really would like to create my dialog boxes within a resource editor and use that resource file as my reference for the dialog box within my program, and so that's what Ive been doing... However in my program I want to include a slider toolbar to change iterations for fractal generation and this is part of my resource

Code:
IDD_TOOLBAR DIALOGEX 300,-29,236,187
CAPTION "Toolbar"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_POPUP|WS_VISIBLE|WS_CAPTION|DS_MODALFRAME
EXSTYLE WS_EX_TOOLWINDOW
BEGIN
  CONTROL "Close Program",IDC_EXIT,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,142,9,84,15
  CONTROL "",IDC_TRB1,"msctls_trackbar32",WS_CHILD|WS_VISIBLE,82,60,148,20
  CONTROL "Iterations for strange attractor and IFS fractals",IDC_STC1,"Static",WS_CHILD|WS_VISIBLE,84,46,146,9
END
And I have declared it earlier in the program as such:
#define IDC_TRB1 701 // Trackbar 1

When I compile my program the slider toolbar is already on the dialog that I have created, but it's virtually useless because I cant read from it or set its length, or anything!

My question is how do I use the resource.rc file where my toolbar is coded and initialize the toolbar elsewhere in my program, psuedocode or code references would be appreciated.

I know that people have declared that a toolbar was to be created right at the WM_CREATE part of the window initialization, but instead of useing:
Code:
track_bar = CreateWindowEx(NULL, TRACKBAR_CLASS,
    "Trackbar", WS_CHILD | WS_VISIBLE | TBS_AUTOTICKS | TBS_ENABLESELRANGE,
    10, 10, 200, 30, hwnd, (HMENU)ID_TRACKBAR, hinstance_main, NULL );
I would rather like to use my predefined toolbar from the .rc file, sorry if im being redundant.

Also I'm rather new to WIN32 API programming, I miss VGA, so please be patient with me if Ive been rather blatantly ignorant to certain aspects of API programming
parad0x13 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Win32 API or Win32 SDK? jverkoey General Discussions 2 07-20-2005 03:26 PM
OpenSSL and Win32 SSL API :: SSL/TLS kuphryn Networking/Device Communication 0 03-10-2004 07:46 PM
FILES in WinAPI Garfield Windows Programming 46 10-02-2003 06:51 PM
OLE Clipboard :: Win32 API vs. MFC kuphryn Windows Programming 3 08-11-2002 05:57 PM
Thread Synchronization :: Win32 API vs. MFC kuphryn Windows Programming 2 08-09-2002 09:09 AM


All times are GMT -6. The time now is 10:58 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22