Click here to Skip to main content
15,907,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is "dialog template resource"? SOLVED Pin
Vaclav_20-Sep-13 4:06
Vaclav_20-Sep-13 4:06 
GeneralRe: What is "dialog template resource"? SOLVED Pin
pasztorpisti20-Sep-13 4:31
pasztorpisti20-Sep-13 4:31 
GeneralRe: What is "dialog template resource"? SOLVED Pin
Vaclav_20-Sep-13 5:46
Vaclav_20-Sep-13 5:46 
Questionhow to registered activex contols Pin
joshikkishore18-Sep-13 7:48
joshikkishore18-Sep-13 7:48 
AnswerRe: how to registered activex contols Pin
Richard Andrew x6418-Sep-13 10:21
professionalRichard Andrew x6418-Sep-13 10:21 
AnswerRe: how to registered activex contols Pin
«_Superman_»18-Sep-13 18:35
professional«_Superman_»18-Sep-13 18:35 
QuestionHow to retrive / enumerate CDialog controls Pin
Vaclav_18-Sep-13 3:49
Vaclav_18-Sep-13 3:49 
AnswerRe: How to retrive / enumerate CDialog controls Pin
pasztorpisti18-Sep-13 4:22
pasztorpisti18-Sep-13 4:22 
If you want to modify gui elements programmatically then it is a big hack that may or may not work on other machines. Even if we know how to do this magic we don't know what you want to do and we can't read your mind to find it out. It is possible to traverse the window/child control hierarchy and if you can identify certain controls then you can manipulate them. Often identifying the controls is possible by their/their parents' Z order and/or control ID. Depending on what you want to do different kind of hacks/functions may be necessary.

EDIT: as a first step you should write a function that prints out the full window hierarchy of your dialog along with some extra info with each child control window (like hwnd value, control id, classname). Use the GetWindow() function to traverse the window (tree) hierarchy. At the same time you should check the properties of the child controls you want to manipulate with Spy++. This way you can find the location of a control in the hierarchy and write the code that somehow programmatically retrieves the necessary HWNDs from the hierarchy for you. When you are done you will have to manipulate the gui controls by calling windows functions and sending messages to the HWND of the given control.

EDIT: Here is a piece of code that prints you the tree you can view with Spy++. This small piece of code contains a few function calls that can come handy when its about getting the HWND of a specified child control in the gui hierarchy:
C++
void PrintInfo(HWND wnd, int level)
{
    for (int i=0; i<level; ++i)
        printf("    ");
    char classname[0x100];
    classname[GetClassNameA(wnd, classname, sizeof(classname))] = 0;
    printf("HWND=%p ctrl_id=%d classname='%s'\n", (void*)wnd, GetDlgCtrlID(wnd), classname);
}

void TraverseTree(HWND parent, int level)
{
    PrintInfo(parent, level);
    ++level;

    HWND child = GetWindow(parent, GW_CHILD);
    if (!child)
        return;
    do
    {
        TraverseTree(child, level);
        child = GetWindow(child, GW_HWNDNEXT);
    }
    while (child);
}


void WindowFunc()
{
    HWND wnd = FindWindowA("Afx:00400000:b:00010005:00000006:000B078D", NULL);
    if (!wnd)
        ExitProcess(1);
    TraverseTree(wnd, 0);
    ExitProcess(0);
}


modified 18-Sep-13 10:43am.

GeneralRe: How to retrive / enumerate CDialog controls Pin
Vaclav_18-Sep-13 7:43
Vaclav_18-Sep-13 7:43 
GeneralRe: How to retrive / enumerate CDialog controls Pin
pasztorpisti18-Sep-13 10:58
pasztorpisti18-Sep-13 10:58 
GeneralRe: How to retrive / enumerate CDialog controls Pin
Vaclav_18-Sep-13 12:01
Vaclav_18-Sep-13 12:01 
Questionbytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 18:55
Le@rner17-Sep-13 18:55 
AnswerRe: bytes to mb conversion upto two decimal places. Pin
Richard MacCutchan17-Sep-13 21:06
mveRichard MacCutchan17-Sep-13 21:06 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 21:27
Le@rner17-Sep-13 21:27 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Richard MacCutchan17-Sep-13 21:35
mveRichard MacCutchan17-Sep-13 21:35 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
Le@rner17-Sep-13 21:38
Le@rner17-Sep-13 21:38 
AnswerRe: bytes to mb conversion upto two decimal places (fixed). Pin
CPallini17-Sep-13 21:47
mveCPallini17-Sep-13 21:47 
SuggestionRe: bytes to mb conversion upto two decimal places. Pin
pasztorpisti17-Sep-13 23:21
pasztorpisti17-Sep-13 23:21 
GeneralRe: bytes to mb conversion upto two decimal places. Pin
CPallini17-Sep-13 23:32
mveCPallini17-Sep-13 23:32 
AnswerRe: bytes to mb conversion upto two decimal places. Pin
_Flaviu17-Sep-13 22:19
_Flaviu17-Sep-13 22:19 
AnswerRe: bytes to mb conversion upto two decimal places. Pin
pasztorpisti17-Sep-13 23:19
pasztorpisti17-Sep-13 23:19 
QuestionCreating a DLL with Web Browser Embedded Pin
Don Guy17-Sep-13 9:48
Don Guy17-Sep-13 9:48 
AnswerRe: Creating a DLL with Web Browser Embedded Pin
Richard Andrew x6417-Sep-13 15:34
professionalRichard Andrew x6417-Sep-13 15:34 
AnswerRe: Creating a DLL with Web Browser Embedded Pin
Richard MacCutchan17-Sep-13 21:04
mveRichard MacCutchan17-Sep-13 21:04 
GeneralRe: Creating a DLL with Web Browser Embedded Pin
Don Guy18-Sep-13 4:15
Don Guy18-Sep-13 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.