|
Thank you very much for your solution
|
|
|
|
|
Use ::CreateIconIndirect . Didn't try it myself, but seems to suit your needs.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you very much for you solution.
|
|
|
|
|
There is a catch with this, I know this cause I just finished writing some bmp to icon converter code at home - if you want the code just email me, the problem is the ICONINFO structure need two HBITMAPs, the first or the hbmColor can be created how ever you want, 8 bit, 16 bit, etc. But the second HBITMAP MUST be created as a 1 bit bitmap if you want the mask to work right (at least that was the only way I got it to work correctly). And once you have created a the bitmap you iterate through the bits a little differently than normal since each bit represents a pixel. The code I wrote handles conversion from a 32bit HBITMAP to an HICON. you can email me at ddiego@one.net if you want the code
|
|
|
|
|
Hi !
I have a ListView app, in which I want to implement drag'n drop to allow the user to move the listed objects.
I tried to find where to start. In the MSDN, I only found info about drag'n drop between different app using OLE, but in my case, I want to have drag'n drop only in my own app.
Anyone could give me some hints on where to start ?
Thank you !
Jerome
|
|
|
|
|
Check the Drag & Drop area at CodeGuru Listview Control section. There're at least two articles on the subject.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
when i use setwindowtext(),the title has often been changed automatically,why?
|
|
|
|
|
The Child Windows of MFC use the title of the associated document as the title of the window frame (automatically). To change the title of the window frame, all you need to do is change that in the document using :
pDoc->SetTitle(WHATEVER_YOU_WANT);
and you should notice that the title in the window frame has been automatically updated to reflect this.
P.S. make sure you get the active document (pDoc) by using the GetActiveDocument() member function of the CHILD frame or view.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
thanks!
now i have only one document, and three views,
how i do it?
|
|
|
|
|
|
the hwnd should be a member var. of the CFileDialog - Class (m_hwnd)
if you want to get the path of the selected file use CFileDialog::GetPathName
or if you have got multiple selection you have to use CFileDialog::GetStartPosition and CFileDialog::GetNextPathName
hope this helps
bernhard
"There are three roads to ruin: women, gambling and technicians. The most pleasant is with women, the quickest is with gambling, but the surest is with technicians." Georges Pompidou
|
|
|
|
|
i want to make the main window invisible at the start of my application.my program is dialog based MFC application.
how to? thanks.
|
|
|
|
|
Set a timer in your InitDialog [say a 3 second timer]
Now the timer gets called [after 3 seconds]
ShowWindow(SW_HIDE) and remove the timer
Nish
p.s. putting ShowWindow(SW_HIDE) in InitDialog won't work cause of the manner in which modal dialogs are created and shown on screen
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Unselect the "Visible" style at the dialog resources properties tab, add a BOOL m_bFirstShowWindow variable to your CDialog -based class, initialize m_bFirstShowWindow to TRUE on construction time, and add the following message handler for WM_WINDOWPOSCHANGING :
void CYourDlg::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
{
CDialog::OnWindowPosChanging(lpwndpos);
if(lpwndpos->flags&SWP_SHOWWINDOW){
if(m_bFirstShowWindow){
m_bFirstShowWindow=FALSE;
lpwndpos->flags&=~SWP_SHOWWINDOW;
}
}
} Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sorry to trouble you again.
I can't find the WM_WINDOWPOSCHANGING message in the Class Wizard.so i don't know how to add the message handle function.
How can i generate the function OnWindowPosChanging?
tank you.
|
|
|
|
|
Sorry to trouble you again.
No problem
MFC Class WIzard -> Class Info tab -> Advanced Options -> Message filter -> Window
This message filter thing is IMHO a little annoying and a constant source of confusion.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Here's another way:
1. Uncheck the "Visible" checkbox from the dialog resource.
2. Construct the dialog box modelessly:
In your CWinApp-derived class, replace the code in your InitInstance (after Enable3dControlStatic) with something like this:
static CYourDlg dlg;
dlg.Create(CYourDlg::IDD);
m_pMainWnd = &dlg;
return TRUE;
Regards,
Alvaro
|
|
|
|
|
I set a hook over system to draw a button into caption area. I succeed.
And I want when I press Left Mouse BUtton on this button, it pop up a ownerdraw menu, what can i do ?
|
|
|
|
|
Hi
I have a popup-menu associated with a window, and I want to specify for each menu entry if it is enabled/disabled. So I'm wondering if my window sends some messages (similar to WM_LBUTTONDOWN for example) just before displaying a menu item? I would like to be able to intercept that message and actualize the enabled/disabled state of that item. I read something about ON_UPDATE_COMMAND_UI but my window is created with CreateWindowEx and I can't do anything with classwizard.
How can I handle this task easily
Thanks
|
|
|
|
|
Handle WM_INITMENU.
See MSDN to read about WM_INITMENU
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
I dynamically construct the popup menu when I detect a right mouse button click. This way, you can set the disabled state of individual menu items.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
That works fine, thanks
|
|
|
|
|
How to change parameters of video source: brightness, contrast and other? Not in the reference dialog box (capDlgVideoSource), by means of a movable indicator. For example, it's necessary automatically to customize all these parameters in program at startup (entering their numerical significances). Whether there are any functions, variable or something for a modification of these parameters?
|
|
|
|
|
i'd like to get string laid below mouse pointer using mouse hooking in another application.
if example source exist, let me show. thank you
have a nice day
|
|
|
|
|
If your string wants to get laid, just send it to a singles bar.
Seriously, this question gets asked over and over again here, I don't get why, but the answer is simply that to get ANY visible string you need to use screen capture and write some funky OCR stuff, to get any PARTIALLY visible string that is written (not in a bitmap) you need to use GetWindowText and GetFont to figure out the metrics of which word you are over.
Neither of these is a simple enough task to get a quick answer in a forum. I've also asked every person who asks this question and no-one has ever told me *why* they want to do it, beyond the fact that there are one or two apps about devoted to the purpose for the reason of providing tranlations between languages.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|