|
load the XML into the DOM in a try/catch block.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi,
I'm creating a simple Win32 App (No MFC).
ProgramList = CreateWindow("LISTBOX", "BLAH", WS_VISIBLE|WS_CHILD | LBS_STANDARD | LBS_NOTIFY ,10, 10, 250, 400, hwnd, (HMENU)10, GetModuleHandle(NULL), NULL);
SendMessage(ProgramList,LB_ADDSTRING,0,(LPARAM)(LPTSTR)"test 1");
SendMessage(ProgramList,LB_ADDSTRING,0,(LPARAM)(LPTSTR)"test 2");
SendMessage(ProgramList,LB_ADDSTRING,0,(LPARAM)(LPTSTR)"test 2");
This creates my Listbox and three strings.
Now, how do I change the text and background color in the listbox?
I tried this: SetTextColor(GetDC(ProgramList), RGB(132, 123, 213));,
But nothing happens. I tried adding LBS_OWNERDRAWFIXED to the CreateWindow function of the listbox. But then the listbox just turns white, no text nothing.
What am I doing wrong?
Thanks for any help.
|
|
|
|
|
Read up on the WM_CTLCOLORLISTBOX message...it should let you do all you need...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I checked it on MSDN, but didnt find anything usefull, do you know the exact page you where talking about?
|
|
|
|
|
The message description...it explains exactly what it's for...
Check MSDN again but look under MFC instead it explains exactly how it works
CWnd::OnCtlColor()
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Thanks, but I can't use MFC.
|
|
|
|
|
Check out CXListBox: http://www.codeproject.com/combobox/xlistbox.asp
Best wishes,
Hans
|
|
|
|
|
Thanks , but I can't use MFC.
|
|
|
|
|
Hello there,
I loaded a file data into void* variable ...
Is there any way to get length from that ?
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Can I first ask why you've loaded the data into a void * ? void * is very nasty. You cannot do anything with it until you cast it to something, and you cannot tell what it needs to be cast to. The point of loading is the most likely time to retrieve a length.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I don't know how you could keep your calm with that question.
How low can you go ? (MS rant)
|
|
|
|
|
I would listen Christian first, but incase your stubborn like me...
void* pBuff = malloc();
UINT nSize = _msize(pBuff);
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Great, That's it
Thanks alot for help
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
hi,
i tried to populate a treeview with database calls.. i populate the treeview by populate a node for a record.. each record retrieved from the database call contains an unique id and a description.. i was able to populate the tree with all the description, but i don't know how to store/populate the unique id in the treeview, which is associated to the description.. the unique id and description need to be popuated together in a node.. any help is appreciated.. thank you!
|
|
|
|
|
Use CTreeCtrl::SetItemData()
Cheers
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
can you point me to a link with an example on how it's done?
i created a new class, which contains a new datastructure and i tried to append the new datastructure using setitmedata, but didn't work..
this is what i done:
hItem = trCtrl.InsertItem( "some string", 0, 2 );
trCtrl.SetItemData(hItem, (DWORD)myID);
i get error C2440: 'type cast' : cannot convert from 'nodeData' to 'DWORD'
|
|
|
|
|
What kind of data is MyID?
by other side you must to ckeck if hItem has a valid value (hItem != NULL)
Regards
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
I create a class for storing the id data..
this is how i define MyID Class in short:
the variable Id is a private int variable. I create a new class for the unique id because if i want to store more data, i can just modify the class.
Class nodeData {
nodeData::nodeData() {
Id = 0;
}
nodeData::nodeData(int x) {
Id = x;
}
}
|
|
|
|
|
One of the third party dlls I used keeps showing a useless modal dialog box. I want to close the dialog box by "clicking" the Yes button from my program. How do I do that?
I was able to get the windows handles of the dialog box and the Yes button. I tried posting WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK messages with no success. While the messages were posted, I saw the Yes button being "clicked" (depressed) over and over again, but the dialog box just stayed open. If I post the WM_CLOSE message, then the dialog box can be closed but my program won't work because what I need is "clicking" the Yes button.
Any suggestion or tip is appreciated. Thanks.
P.S. BTW, I was posting messages to the dialog box from a separate thread.
|
|
|
|
|
This works for me:
SendMessage(wndParent,WM_COMMAND,MAKEWORD(::GetDlgCtrlID(wndButton),BN_CLICKED),(LPARAM)wndButton);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Gregor S. wrote:
This works for me:
SendMessage(wndParent,WM_COMMAND,MAKEWORD(::GetDlgCtrlID(wndButton),BN_CLICKED),(LPARAM)wndButton);
Thanks.
I tried it. The dialog box is still open after the above code is executed. But if I click anywhere on the screen outside the dialog, the dialog will be closed. Actually, this is what happened when I post the WM_LBUTTONDOWN and WM_LBUTTONUP messages: I have to click somewhere outside the dialog to make it close.
Any other suggestion?
|
|
|
|
|
Mhhh, you might try to simulate the mouseclick outside the dialog with
SendMessage(wndParent, WM_ACTIVATE, MAMKEWORD(WA_INACTIVE, 0), LPARAM(HWND_DESKTOP));
But I have not testet it, but actually it should would
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks for your help. The problem was solved with a ::EndDialog call. See my other post for details.
|
|
|
|
|
Why don't you sent it WM_CLOSE ?
What is the useless dialog ? If it's a 'This person has not bought this component, for evaluation only' type deal, you'd expect it to be coded to be hard to close apart from via the button, for example it could check if the mouse is over the button when it is pressed.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|