Solved

Any C++ person will know this...im newer....

Posted on 2004-09-07
7
240 Views
Last Modified: 2012-05-05
Ok, im doing win32 programming and begining to figure things out. I just want to know howto do a couple basic things. Although it does'nt really matter too much I am compiling using Mingw 3. All sample programs built for MS vC++ have compiled fine.  I am hard coding all the events and everything although as noted below i want to use dialogs.
What i want to know includes:

Utilize and use a dialog interface compiled with resource compiler in my code.

Access\Alter a controls properties [I know a bunch of api calls that can manipulate certain properties, but i want like the -> or . funcitons so i can directly access properties of a control.] Or is this done using the Getmessage and Sendmessage? How do i use them to do this?

If its not too complex access to Active X would also be nice. Im not using MFC. Im rather new to c++ but have a pretty solid base. If someone built a sample application it would be nice for them to include howto put a value from one textbox to another, howto add items to a listbox, and howto set common form properties. I would sacrifice much of this if i just knew howto use dialog resources from my code.
0
Comment
Question by:Th3_GOD
  • 5
  • 2
7 Comments
 
LVL 1

Author Comment

by:Th3_GOD
ID: 11998310
Ok ive figured out howto manipulate properties of controls but now need to know howto get the text from text boxes etc. I would also like to know what a good reference for the list of commands to use with SendMessage and its corresponding common controls. By the way im an experienced VB programmer and know many server side web scripting langauges including php, if that helps anyone calibrate their answers.
0
 
LVL 30

Expert Comment

by:Axter
ID: 11998818
You can use the GetWindowText API function
0
 
LVL 30

Expert Comment

by:Axter
ID: 11998832
Example usuage:
char szCurrentWindowName[1024];
::GetWindowText(hwndNextChild,szCurrentWindowName,sizeof(szCurrentWindowName));
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 30

Expert Comment

by:Axter
ID: 11998862
Also see WM_GETTEXT and WM_SETTEXT.

SendMessage(
  (HWND) hWnd,              // handle to destination window
  WM_GETTEXT,               // message to send
  (WPARAM) wParam;          // number of characters to copy
  (LPARAM) lParam;          // text buffer
);
0
 
LVL 1

Author Comment

by:Th3_GOD
ID: 12007769
The sendmessage stuff is what im specifically looking for. I know about all the special API funcitons that can set backgrounds get text etc.  That works but i like a universal way to access control properties weather or not theirs an API call for it. I take it i just stick the variable \ a pointer to the variable in the lParam. One thing though thats still unanswered. Where can i get a reference for all the messages i can send with send message? Also is it easy to use activeX controls? One thing that i do Need anwers to is howto use dialogs once I've compiled them using a resource compiler. :|
0
 
LVL 30

Accepted Solution

by:
Axter earned 240 total points
ID: 12008020
Check out following links:
http://decoder.dk/prog/win32api/content.html
http://cvs.sourceforge.net/viewcvs.py/nsis/NSIS/Include/WinMessages.nsh?rev=1.3

If you need details on any of the WM_ variables, you can also do a keyword search on MSDN.

Example:
http://search.microsoft.com/search/results.aspx?qu=WM_GETTEXT
0
 
LVL 30

Expert Comment

by:Axter
ID: 12008033
>>That works but i like a universal way to access control properties weather or not theirs an API call for it

There's no universal way to access control properties.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now