Hi! I'm trying to find an article of any good example of how to implement a drag and drop Button Control. I want this button to be dragged and across the Dialog and then dropped on another buttun which generates a MessageBox saying that Drag And Drop works. Should be simple but I can't find any good information or anyone that can help me out. Maybe dragging and dropping an image would make it more simple. Or any other type of Control. Every example I get, is of dragging items in a TreeCtrl or just text in an Edit Control. I want the whole Control to be dragged. Please Help!
Hachaso
Posts
-
Drag and Drop -
Idle state on a Dialog based App!Is there a way to override OnIdle using a Dialog based app? something like: BOOL MyDialog::OnIdle() { // My code }
-
How to Check/ Uncheck menu itemHi! I'm trying to add a menu to my dialog based program. In one of the submenus and submenuitem can be checked/unchecked. I don't know what I'm doing wrong but I can't make it to do this. No sign of it being checked appears. Here's the part where I think should do this but I don't know what to add. void CTestProgramForTestWATH2cppDlg::OnUpdateHelpCheckthis(CCmdUI *pCmdUI) { // TODO: Add your command update UI handler code here CWnd* pBar; if ((pBar = GetDlgItem(pCmdUI->m_nID)) == NULL) { pCmdUI->ContinueRouting(); return; // not for us } pCmdUI->m_pSubMenu->CheckMenuItem(ID_HELP_CHECKTHIS, MF_CHECKED); } BOOL CTestProgramForTestWATH2cppDlg::OnHelpCheckthis(UINT nID) { // TODO: Add your command handler code here return TRUE; } Does the function CheckMenuItem do what I request??
-
Click on Edit Control??Well I used EN_SETFOCUS but ans I wrote before I get the messagebox 2 times. I only want it to appear when I click on the Edit Control.
-
Windows Event MessagesIf you want I can attach the whole project. I'm trying to do this unique things to learn. Where can I send you all my files? This way you can see my problem.
-
Click on Edit Control??Do you mean that I capture EN_SETFOCUS... display the messagebox and then with SendMessage deliver EN_KILLFOCUS. Cause I tryed to capture EN_SETFOCUS and I manage to display the messagebox but it appears 2 times in a row.. strange.
-
Click on Edit Control??What event is sent when I click on an Edit Control that is in a Dialog box? I want a messagebox to appear when I click on the edit control. Thanks!
-
Windows Event MessagesMy thir Dialog is ModelLess. Hope you have an answer to my problem.
-
Windows Event MessagesI'm having a small problem with my test program. I have a Dialogbased program that has a bunch of buttons. When I click on one of them, another Dialog appears. This new Dialog has only one button, called "Continue". Here's where my problem starts. This new dialog that appears should after a couple of seconds activate another Dialog. This is done by a timer or Sleep function. The thing is that I manage to get the third Dialog to appear automatically but I found that the Second Dialog with the button "Continue" didn't show the button. It's like the Dialog is drawn but not the button. Hope you understand my problem. Is there any event that is sent afte the whole Dialog is painted, including the button or other controls? I've tryed, WM_PAINT, WM_ACTIVATE, WM_SHOWWINDOW. Please help!
-
Create a button that can be dragged and dropped??Thanks! But can this be done using OLE drag and drop? If so, how do I do it? Can't seem to find any good information of how to drag Controls. Thanks!
-
Drag and Drop Button ControlHi! Can someone please help me how to write a button control that can be dragged and dropped? I want to drag the button from one side of the Dialog to the other. I'm doing this to learn. Thanks!
-
Create a button that can be dragged and dropped??Hi! How can I create a button on a Dialog that can be dragged and dropped? Thanks!
-
Menu on Dialog Box based programHi! How can I create a Menu on a Dialog Box based program? I'm trying to write it using Win32 API calls not MFC. I can't seem to be able to display the menu on the Dialog. Please Help!
-
using ifstream to read a file.Well I need to get some more data from the file. Is it possible or not?
-
using ifstream to read a file.Hi! I'm creating a small program that reads from a text file, using ifstream. I'm wondering how I can tell the stream to start reading the file from the beginning? Is this possible or do I have to close the file and reopen it? This is what I'm doing: ifstream file(filename); if(!file.is_open()) { // Error message. } while(!file.eof()) { file.getline(buf, 200); // after comes more code that is not relevant here. } When I do this getline starts reading line by line. So how can I tell it to start from the beginning? Thanks!
-
C++ file I/OHi! I'm trying to write a small program that analyzes the text in a normal text file. I'm using the C++ ifstream methods. My question is: char *buf; buf = new char; ifstream file("test.txt"); ... file.getline(buf, 100); When I do this buf will contain a row of text. How do I do to know the size of buf?? I've tried sizeof(buf) but I get = 4 Debugging the code I see that buf has more then 4 character...counting them I get to 77. Any good tips! Thanks!
-
Disable or Enable a ButtonHi! I'm wondering how to Disable and Enable a button. For example I'm trying to create a small program where you mark a checkbox, doing this Enables the button to continue. If it's unchecked the button is disabled. To make it disabled is easy, cause I make it as default as disabled. My problem is how do I do to Enable it when the checkbox is checked? I'm writing it in Win32 API...no MFC Please help!
-
How to use EnumSystemLanguageGroupsHi! Hope I'm not to much trouble. I'm kind of new to this so thanks for all the help. DavidCrow wrote: Huh? LANGUAGEGROUP_ENUMPROC is a typedef from winnls.h. I hope I understand this right: How do I use this typedef? LANGUAGEGROUP_ENUMPROC EnumProc; (like this ??) Then declare the callback function: BOOL CALLBACK EnumProc( LGRPID LanguageGroup, LPTSTR lpLanguageGroupString, LPTSTR lpLanguageGroupNameString, DWORD dwFlags, LONG_PTR lParam ) { return TRUE; } Then send this to EnumSystemLanguageGroups: EnumSystemLanguageGroups(EnumProc, LGRPID_INSTALLED, 0); Is this how it is supposed to be used?? I read a remark in the page link you gave me; This function can carry out any desired task. An application registers an EnumLanguageGroupsProc function by passing its address to the EnumSystemLanguageGroups function. I'm really new to all this, so please explain in details. Thanks!
-
How to use EnumSystemLanguageGroupsHi Again! Thank you once more for helping me out. I've compared and can't find any difference that would solve the problem. I've looked at the weblink you gave me. That's the page that I've been looking at all the time. My problem is that they explain what the function does and what the different parameters do but they don't give you any example code. For example, BOOL EnumSystemLanguageGroups( LANGUAGEGROUP_ENUMPROC pLangGroupEnumProc, // callback function DWORD dwFlags, // language groups LONG_PTR lParam // callback parameter ); LANGUAGEGROUP_ENUMPROC is retrieved from another function called EnumLanguageGroupsProc. When I try, using the headerfiles needed and kernel32.lib I come to the conclusion that It may not exist anymore. Cause it doesn't recognize it. Could you maybe help med with some example how to implement the different parameters, so that I can understand what I'm doing wrong. Thanks!
-
Code example!!Hi Again! Reading a little about this callback functions I understand that EnumSystemLanguageGroups is used with this callback function EnumLanguagesGroupsProc. The question is how do I use them together. EnumSystemLanguageGroups has a parameter of type, LANGUAGEGROUP_ENUMPROC. Which is passed from EnumLanguageGroupsProc. Can you maybe give me an example of how to use them? Thanks!