Search Results

Search found 47 results on 2 pages for 'dialogbox'.

Page 1/2 | 1 2  | Next Page >

  • DialogBox in Win32 - Prevent multiple instance

    - by UK
    Hello all, I have a program which creates DialogBox window when user clicks the menu item from tray icon, case ID_OPTIONS: DialogBox ( GetModuleHandle ( NULL ), MAKEINTRESOURCE ( IDD_SETUP_DIALOG ), hWnd, reinterpret_cast<DLGPROC>(SetupDlgProc) ); return 0; But the problem here is everytime when users clicks item from tray , a new instance of the dialogbox appears. Is there anyway to prevent this multiple instance ? BTW, my SetupDlgProc looks like this, BOOL CALLBACK SetupDlgProc ( HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam ) { switch ( Message ) { case WM_INITDIALOG: ... } } Thanks for your help.

    Read the article

  • Save as DialogBox to save textbox content to a newfile using asp.net

    - by user195114
    I want the users to type their text in the given textbox and on clicking on createNewFile Button, a SaveAs Dialogbox should popup and the users should browse through the location and save the file as desired. I have tried some thing but (1) the dialog box goes behind the application (2) when run, dialogbox opens 3 times, means it executes 3 times REPLY TO THE POST protected void btnNewFile_Click(object sender, EventArgs e) { StreamWriter sw = null; try { SaveFileDialog sdlg = new SaveFileDialog(); DialogResult result = sdlg.ShowDialog(); sdlg.InitialDirectory = @"C:\"; sdlg.AddExtension = true; sdlg.CheckPathExists = true; sdlg.CreatePrompt = false; sdlg.OverwritePrompt = true; sdlg.ValidateNames = true; sdlg.ShowHelp = true; sdlg.DefaultExt = "txt"; // sdlg.ShowDialog = Form.ActiveForm; string file = sdlg.FileName.ToString(); string data = txtNewFile.Text; if (sdlg.ShowDialog() == DialogResult.OK) { sw.WriteLine(txtNewFile.Text); sw.Close(); } if (sdlg.ShowDialog() == DialogResult.Cancel) { sw.Dispose(); } //Save(file, data); } catch { } finally { if (sw != null) { sw.Close(); } } } private void Save(string file, string data) { StreamWriter writer = new StreamWriter(file); SaveFileDialog sdlg1 = new SaveFileDialog(); try { if (sdlg1.ShowDialog() == DialogResult.OK) { writer.Write(data); writer.Close(); } else writer.Dispose(); } catch (Exception xp) { MessageBox.Show(xp.Message); } finally { if (writer != null) { writer.Close(); } } } I have tried this.

    Read the article

  • Giving dialogbox focus

    - by Dave18
    I'm creating a dialogbox with a picture control and whenever I initialize the dialog it sets the focus to that picture control, is there any way to give dialog the default without resetting the focus from picture control?

    Read the article

  • In registration form adding date dialogbox how can apply validation in system date in dialog ends

    - by narasimha
    hi i am implementing registration form adding date field then click icon to display date dialog window then limit date validation in system date below date only how can implement the validation protected Dialog onCreateDialog(int id) { Calendar c = Calendar.getInstance(); int cyear = c.get(Calendar.YEAR); int cmonth = c.get(Calendar.MONTH); int cday = c.get(Calendar.DAY_OF_MONTH); switch (id) { case DATE_DIALOG_ID: return new DatePickerDialog(this, mDateSetListener, cyear, cmonth, cday); } return null; } private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { String date_selected = String.valueOf(monthOfYear+1)+" /"+String.valueOf(dayOfMonth)+" /"+String.valueOf(year); EditText birthday=(EditText) findViewById(R.id.EditTextBirthday); birthday.setText(date_selected); } }; public void onClick(View v) { if(v == b1) showDialog(DATE_DIALOG_ID); } } ** showing in system date in below dates only how can implemented some solution in running year to below years are display not incrementing above years this condition are appliying validations how can implemented ?

    Read the article

  • Connecting two DialogBoxes in GWT

    - by Apophenia Overload
    In my GWT project, I'm trying to get it so two DialogBoxes can pass information between each other. One of them holds a MapWidget, and when a button is pressed in the other DialogBox, the position information is received from that other DialogBox's MapWidget. Does anyone have any tips for how I should coordinate between having two different DialogBoxes show up? Should I wrap the code for the two in a Composite? Furthermore, is there an example anywhere of dealing with two DialogBoxes at once in GWT? For example, if I click outside of the two boxes, both should be dismissed. I'm wondering if there's a way to keep both of them in focus at once, so I can switch between the two without causing either to disappear.

    Read the article

  • Why can't my program display this dialog box, while another program can?

    - by nonoitall
    I'm trying to write a wrapper for Winamp input plugins and have hit a bit of a snag. I'd like my wrapper to be able to display a plugin's configuration dialog, which is (or should be) achieved by calling the plugin's Config(HWND hwndParent) function. For most plugins, this works fine and my program is able to display the plugin's configuration dialog. However, 64th Note (a plugin for playing USF files) is giving me problems. Winamp can display its configuration dialog just fine, but whenever I try to display it from my wrapper, the dialog gets destroyed before it ever shows itself. Thankfully, 64th Note is open source, so I took a look at its innards to try and get an idea of what's going wrong. I've trimmed off the irrelevant bits and am left with this: Config function in the plugin (should show configuration dialog): void Config(HWND hwndParent) { DialogBox(slave, (const char *) IDD_CONFIG_WINDOW, NULL, configDlgProc); } (Slave is the plugin DLL's HINSTANCE handle.) The proc for the dialog is as follows (I have stripped out all the functionality, since it doesn't appear to have an influence on this problem): BOOL CALLBACK configDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { return 0; } The template for IDD_CONFIG_WINDOW is as follows: IDD_CONFIG_WINDOW DIALOGEX 0, 0, 269, 149 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "64th Note configuration" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "OK",IDOK,212,38,50,14 CONTROL "Play Forever",IDC_NOLENGTH,"Button",BS_AUTORADIOBUTTON,7,7,55,8 CONTROL "Always Use Default Length",IDC_SETLEN,"Button",BS_AUTORADIOBUTTON,7,17,101,8 CONTROL "Default Length",IDC_DEFLEN,"Button",BS_AUTORADIOBUTTON,7,29,63,8 EDITTEXT IDC_DEFLENVAL,71,28,38,12,ES_AUTOHSCROLL EDITTEXT IDC_DEFFADEVAL,71,42,38,12,ES_AUTOHSCROLL CONTROL "Detect Silence",IDC_DETSIL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,56,63,8 EDITTEXT IDC_DETSILVAL,71,56,38,12,ES_AUTOHSCROLL CONTROL "Slider2",IDC_PRISLIDER,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,74,90,108,11 EDITTEXT IDC_TITLEFMT,7,127,255,15,ES_AUTOHSCROLL CONTROL "Default to file name on missing field",IDC_FNONMISSINGTAG, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,114,124,8 CONTROL "Use Recompiler CPU",IDC_RECOMPILER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,7,83,8 CONTROL "Round Frequency",IDC_ROUNDFREQ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,16,73,8 CONTROL "Seek Backwards",IDC_BACKWARDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,26,70,8 CONTROL "Fast Seek",IDC_FASTSEEK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,35,48,8 CONTROL "RSP Sections",IDC_SECTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,45,60,8 CONTROL "Soft Amplify",IDC_SOFTAMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,54,53,8 CONTROL "Audio HLE",IDC_AUDIOHLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,63,50,8 CONTROL "Auto Audio HLE",IDC_AUTOAUDIOHLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,72,64,8 CONTROL "Display Errors",IDC_DISPERROR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,145,81,58,8 EDITTEXT IDC_RELVOL,211,104,28,12,ES_AUTOHSCROLL PUSHBUTTON "Cancel",IDCANCEL,212,54,50,14 PUSHBUTTON "Help",IDHELPBUTTON,212,71,50,14 LTEXT "Title format:",IDC_STATIC,7,113,38,8 LTEXT "seconds",IDC_STATIC,112,29,28,8 LTEXT "Default Fade",IDC_STATIC,19,43,42,8 LTEXT "seconds",IDC_STATIC,112,43,28,8 LTEXT "seconds",IDC_STATIC,112,57,28,8 CTEXT "CPU Thread Priority",IDC_STATIC,7,91,63,8 CTEXT "Look ma, I'm data!",IDC_CPUPRI,75,104,108,8 LTEXT "Relative Volume",IDC_STATIC,199,94,52,8 LTEXT "Fade Type",IDC_STATIC,7,75,35,8 COMBOBOX IDC_FADETYPE,45,72,87,74,CBS_DROPDOWNLIST | WS_TABSTOP END Naturally, without any substance in the proc function, the dialog doesn't have any functionality, but it still displays in Winamp when the Config function is invoked. However, it does not appear when I invoke it from my wrapper program. When I monitored the messages sent to the dialog in its proc function, I saw that WM_DESTROY and WM_NCDESTROY were sent within the first few messages, though I have no clue as to why. If I change the Config function so that it displays the plugin's About dialog instead of its configuration dialog, both Winamp and my wrapper will display the About dialog, which suggests that there is something unique to the configuration dialog template that's causing the problem. The modified Config function reads like so: void Config(HWND hwndParent) { DialogBox(slave, (const char *) IDD_ABOUTBOX, NULL, configDlgProc); } The template for the About dialog is as follows: IDD_ABOUTBOX DIALOGEX 0, 0, 152, 151 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About 64th Note" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "64th Note v1.2 beta 3\nBased on Project 64 1.6 by Zilmar and Jabo\nAudio HLE by Azimer\nPSF concept and tagging by Neill Corlett\nPlayer by hcs, Josh W, dr0\nhttp://hcs64.com/usf",IDC_STATIC,7,94,138,50 CONTROL 110,IDC_STATIC,"Static",SS_BITMAP,26,7,95,86,WS_EX_DLGMODALFRAME END Like I said, my wrapper displays the About dialog just fine, as does Winamp. Why can Winamp display the Config dialog, while my wrapper cannot?

    Read the article

  • How to get the window position and update to other windows?

    - by Rakesh
    Hi all..I have 2 dialog boxes in which I will display 1 dialogbox at a time..If I click NEXT in the first dialog box,I will hide the first dialog box and display the second dialog and vice versa...Now say If I move the dialog box after clicking NEXT in the first dialog..and when I click BACK(in the second dialog) ...it goes back to its previous position(to diaplay the first dialog box)..so I have decided to get the current window's position and update to the other window position so that it doesnt move even If I click next/back..I am not sure how to get the windows position and update to other..please help me if you guys know about this..

    Read the article

  • How can I access my favorites in a Windows 7 file dialog box?

    - by Edward Tanguay
    When I am in an application which allows me to go get a file, the following dialog box pops up. Of course at this point I often want to have access my favorites, but they are not listed here. How can I get a link to my favorites listed here? If there is no answer, I will have to install filebox extender again like I have been since Windows XP, but I just thought they would have solved this by now in Windows 7.

    Read the article

  • JQUERY Dialog Box

    - by David Bonnici
    Hi Guys, Im trying to do a dialog box with jquery. In this dialog box Im going to have terms and conditions. The problem is that the dialog box is only displayed for the FIRST TIME. This is the code JAVASCRIPT CODE: function showTOC() { $("#TOC").dialog({ modal: true, overlay: { opacity: 0.7, background: "black" } }) } HTML Code (A HREF) class="TOClink" href="javascript:showTOC();">View Terms & Conditions</> <div>id="example" title="Terms & Conditions">1..2.. </div> The problem I think is that when you close the dialog box the DIV is destroyed from the html code therfore it can never be displayed again on screen. Can you please help! Thanks

    Read the article

  • How do I create a class associated with a windows form in C#?

    - by xarzu
    Now that C++ development has become second nature to me, do I have to start from scratch with C#? Since the beginning of Visual Studio, there has been easy way to describe the shape of a Dialog (now called a Form) in the resource file and then use a wizard to create the corresponding C++ code. I kind of remember that in MFC it was pretty much a no-brainer to create a custom dialog with all the components you want and then all the associated code. If I have a C# app that has many forms that I want to bring to the screen based on the user's menu selections, how do I create a class associated with a windows form?

    Read the article

  • problem in showing and hiding dialog boxes in MFC

    - by Rakesh
    Hello all, I am trying to create a wizard like structure using dialog boxes...So I replaced the code in CDialog1App as below CDialog1Dlg* dlg = new CDialog1Dlg; m_pMainWnd = dlg; dlg->Create(IDD_DIALOG1); dlg->ShowWindow(SW_SHOW); the above worked fine...its displying the dialog box.but I have added another dialog box... So in the first dialog box if the user clicks Next it has to hide the first dialog box and display the second dialog.. //CDialog1 class void CDialog1Dlg::OnBnClickedNext() { // TODO: Add your control notification handler code here CDialog2* dialog2 = new CDialog2(); dialog2->Create(IDD_DIALOG2); dialog2->ShowWindow(SW_SHOW); this->ShowWindow(SW_HIDE); } in the above code am creating an object for the Dialog2 class and trying to show that.... Now the problem is,when I click next its hiding both the windows..What can I do..I tried several types but its still its not workin..Please dont suggest me to do with PropertySheet..It will work with that, i know ...but I want this using Dialog Box for some reason

    Read the article

  • how to use JComboBox using Enum in Dialog Box

    - by Edan
    Hi, I define enums: enum itemType {First, Second, Third}; public class Item { private itemType enmItemType; ... } How do I use it inside Dialog box using JComboBox? Means, inside the dialog box, the user will have combo box with (First, Second, Third). Also, is it better to use some sort of ID to each numerator? (Integer) thanks.

    Read the article

  • jQuery dialog box not opening 2nd time

    - by Steven
    I found this thread which basically has the same issue I have. But their solution is not working for me. The dialog appears the first time I click the submit button, but not the 2nd time. I'm opening the dialog box after a form submission. UPDATE I finally got it working. Here is the correct code: if (jQuery('#registrationforms').length > 0) { //instantiate the dialog jQuery("#dialog").dialog({ modal:true, autoOpen:false }); //Some more code here to call processRegistration function. } function processRegistration(instanceID, formData) { jQuery.post("mypath/jquery_bll.php", { instance: 'processRegistration', formData : formData, instanceID : instanceID }, function(feedback) { jQuery('#dialog').text(feedback.message); jQuery('#dialog').parent().addClass(feedback.type); jQuery('#dialog').dialog('open'); },"json"); } Since I'm dynamically applying css class, I have to make sure to add it to the outer DIV which $.dialog creates to wrap my 'dialog' DIV.

    Read the article

  • jQuery programming style?

    - by Sam Dufel
    I was recently asked to fix something on a site which I haven't worked on before. I haven't really worked with jQuery that much, but I figured I'd take a look and see if I could fix it. I've managed to mostly clear up the problem, but I'm still horrified at the way they chose to build this site. On document load, they replace the click() method of every anchor tag and form element with the same massive function. When clicked, that function then checks if the tag has one of a few different attributes (non-standard attributes, even), and does a variety of different tasks depending on what attributes exist and what their values are. Some hyperlinks have an attribute on them called 'ajaxrel', which makes the click() function look for another (hidden) hyperlink with an ID specified by the ajaxrel attribute, and then calls the click() function for that other hyperlink (which was also modified by this same click() function). On the server side, all the php files are quite long and have absolutely no indentation. This whole site has been a nightmare to debug. Is this standard jQuery practice? This navigation scheme seems terrible. Does anyone else actually use jQuery this way? I'd like to start incorporating it into my projects, but looking at this site is giving me a serious headache. Here's the click() function for hyperlinks: function ajaxBoxA(theElement, urltosend, ajaxbox, dialogbox) { if ($(theElement).attr("href") != undefined) var urltosend = $(theElement).attr("href"); if ($(theElement).attr('toajaxbox') != undefined) var ajaxbox = $(theElement).attr('toajaxbox'); // check to see if dialog box is called for. if ($(theElement).attr('dialogbox') != undefined) var dialogbox = $(theElement).attr('dialogbox'); var dodialog = 0; if (dialogbox != undefined) { // if dialogbox doesn't exist, then flag to create dialog box. var isDiaOpen = $('[ajaxbox="' + ajaxbox + '"]').parent().parent().is(".ui-dialog-container"); dodialog = 1; if (isDiaOpen) { dodialog = 0; } dialogbox = parseUri(dialogbox); dialogoptions = { close: function () { // $("[id^=hierarchy]",this).NestedSortableDestroy(); $(this).dialog('destroy').remove() } }; for ( var keyVar in dialogbox['queryKey'] ) eval( "dialogoptions." + keyVar + " = dialogbox['queryKey'][keyVar]"); }; $("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>"); $('#TB_load').show(); if (urltosend.search(/\?/) > 0) { urltosend = urltosend + "&-ajax=1"; } else { urltosend = urltosend + "?-ajax=1"; } if ($('[ajaxbox="' + ajaxbox + '"]').length) { $('[ajaxbox="' + ajaxbox + '"]').each( function () { $(this).empty(); }); }; $.ajax({ type: "GET", url: urltosend, data: "", async: false, dataType: "html", success: function (html) { var re = /^<toajaxbox>(.*?)<\/toajaxbox>+(.*)/; if (re.test(html)) { var match = re.exec(html); ajaxbox = match[1]; html = Right(html, String(html).length - String(match[1]).length); } var re = /^<header>(.*?)<\/header>+(.*)/; if (re.test(html)) { var match = re.exec(html); window.location = match[1]; return false; } if (html.length > 0) { var newHtml = $(html); if ($('[ajaxbox="' + ajaxbox + '"]').length) { $('[ajaxbox="' + ajaxbox + '"]').each( function () { $(this).replaceWith(newHtml).ready( function () { ajaxBoxInit(newHtml) if (window.ajaxboxsuccess) ajaxboxsuccess(newHtml); }); }); if ($('[ajaxdialog="' + ajaxbox + '"]').length = 0) { if (dodialog) $(newHtml).wrap("<div class='flora ui-dialog-content' ajaxdialog='" + ajaxbox + "' style='overflow:auto;'></div>").parent().dialog(dialogoptions); } } else { $("body").append(newHtml).ready( function () { ajaxBoxInit(newHtml); if (window.ajaxboxsuccess) ajaxboxsuccess(newHtml); }); if (dodialog) $(newHtml).wrap("<div class='flora ui-dialog-content' ajaxdialog='" + ajaxbox + "' style='overflow:auto;'></div>").parent().dialog(dialogoptions); } } var rel = $(theElement).attr('ajaxtriggerrel'); if (rel != undefined) $('a[ajaxrel="' + rel + '"]').click(); tb_remove(); return false; }, complete: function () { $("#TB_load").remove(); } }); return false; }

    Read the article

  • accessing widgets inside a GWT element

    - by flyingcrab
    I want to access the text elements inside this textbox in GWT from the main method (where I call it like this) DialogBox aBox = newCandidatePop.buildNewElecPopup(); aBox.center(); aBox.getWidget(); MiscUiTools.newCandidateHandler(aBox.firstName, aBox.surName); in newCandidateHandler i want to attach a click handler to the two text boxes However, the above doesnt quite work - I cant get access to the aBox.firstName elements because they are static methods -- I am wondering what is best practice, how would you code something like this up? static TextBox firstName = new TextBox(); static TextBox surName = new TextBox(); static DialogBox box; // public newCandidatePop() { // box = buildNewElecPopup(); // } static public DialogBox buildNewElecPopup() { DialogBox box = new DialogBox(); box.setAutoHideEnabled(true); box.setText("Add a New Candidate"); box.setAnimationEnabled(true); box.setGlassEnabled(true); Grid dialogGrid = new Grid(2, 3); dialogGrid.setPixelSize(250 , 125); dialogGrid.setCellPadding(10); dialogGrid.setWidget(0, 0, new HTML("<strong>First Name</strong>")); dialogGrid.setWidget(0, 1, firstName); dialogGrid.setWidget(1, 0, new HTML("<strong>Surname</strong>")); dialogGrid.setWidget(1, 1, surName); box.add(dialogGrid); return box; }

    Read the article

  • Applications: How to create a custom dialog box for Windows Mobile 6 (native)

    - by TechTwaddle
    Ashraf, on the MSDN forum, asks, “Is there a way to make a default choice for the messagebox that happens after a period of time if the user doesn't choose (Clicked ) Yes or No buttons.” To elaborate, the requirement is to show a message box to the user with certain options to select, and if the user does not respond within a predefined time limit (say 8 seconds) then the message box must dismiss itself and select a default option. Now such a functionality is not available with the MessageBox() api, you will have to write your own custom dialog box. Surely, creating a dialog box is quite a simple task using the DialogBox() api, and we have been creating full screen dialog boxes all the while. So how will this custom message box be any different? It’s not much different from a regular dialog box except for a few changes in its properties. First, it has a title bar but no buttons on the title bar (no ‘x’ or ‘ok’ button on the title bar), it doesn’t occupy full screen and it contains the controls that you put into it, thus justifying the title ‘custom’. So in this post we create a custom dialog box with two buttons, ‘Black’ and ‘White’. The user is given 8 seconds to select one of those colours, if the user doesn’t make a selection in 8 seconds, the default option ‘Black’ is selected. Before going into the implementation here is a video of how the dialog box works; Custom dialog box To start off, add a new dialog resource into your application, size it appropriately and add whatever controls you need to the dialog. In my case, I added two static text labels and two buttons, as below; Now we need to write up the window procedure for this dialog, here is the complete function; BOOL CALLBACK CustomDialogProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam) {     int wmID, wmEvent;     PAINTSTRUCT ps;     HDC hdc;     static int timeCount = 0;     switch(uMessage)     {         case WM_INITDIALOG:             {                 SHINITDLGINFO shidi;                 memset(&shidi, 0, sizeof(shidi));                 shidi.dwMask = SHIDIM_FLAGS;                 //shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU;                 shidi.dwFlags = SHIDIF_SIPDOWN | SHIDIF_EMPTYMENU;                 shidi.hDlg = hDlg;                 SHInitDialog(&shidi);                 SHDoneButton(hDlg, SHDB_HIDE);                 timeCount = 0;                 SetWindowText(GetDlgItem(hDlg, IDC_STATIC_TIME_REMAINING), L"Time remaining: 8 second(s)");                 SetTimer(hDlg, MY_TIMER, 1000, NULL);             }             return TRUE;         case WM_COMMAND:             {                 wmID = LOWORD(wParam);                 wmEvent = HIWORD(wParam);                 switch(wmID)                 {                     case IDC_BUTTON_BLACK:                         KillTimer(hDlg, MY_TIMER);                         EndDialog(hDlg, IDC_BUTTON_BLACK);                         break;                     case IDC_BUTTON_WHITE:                         KillTimer(hDlg, MY_TIMER);                         EndDialog(hDlg, IDC_BUTTON_WHITE);                         break;                 }             }             break;         case WM_TIMER:             {                 if (wParam == MY_TIMER)                 {                     WCHAR wszText[128];                     memset(&wszText, 0, sizeof(wszText));                     timeCount++;                     //8 seconds are over, dismiss the dialog, select def value                     if (timeCount >= 8)                     {                         KillTimer(hDlg, MY_TIMER);                         EndDialog(hDlg, IDC_BUTTON_BLACK_DEF);                     }                     wsprintf(wszText, L"Time remaining: %d second(s)", 8-timeCount);                     SetWindowText(GetDlgItem(hDlg, IDC_STATIC_TIME_REMAINING), wszText);                     UpdateWindow(GetDlgItem(hDlg, IDC_STATIC_TIME_REMAINING));                 }             }             break;         case WM_PAINT:             {                 hdc = BeginPaint(hDlg, &ps);                 EndPaint(hDlg, &ps);             }             break;     }     return FALSE; } The MSDN documentation mentions that you need to specify the flag WS_NONAVDONEBUTTON, but I got an error saying that the value could not be found, so we can ignore this for now. Next up, while calling SHInitDialog() for your custom dialog, make sure that you don’t specify SHDIF_DONEBUTTON in the dwFlags member of the SHINITDIALOG structure, this member makes the ‘ok’ button appear on the dialog title bar. Finally, we need to call SHDoneButton() with SHDB_HIDE flag to, well, hide the Done button. The ‘Done’ button is the same as the ‘ok’ button, so this step might seem redundant, and the dialog works fine without calling SHDoneButton() too, but it’s better to stick with the documentation (; So you can see that we have followed all these steps above, under WM_INITDIALOG. We also setup a few things like a variable to keep track of the time, and setting off a one second timer. Every time the timer fires, we receive a WM_TIMER message. We then update the static label displaying the amount of time left to the user. If 8 seconds go by without the user selecting any option, we kill the timer and end the dialog with IDC_BUTTON_BLACK_DEF. This is just a #define’d integer value, make sure it’s unique. You’ll see why this is important. If the user makes a selection, either Black or White, we kill the timer and end the dialog with corresponding selection the user made, that is, either IDC_BUTTON_BLACK or IDC_BUTTON_WHITE. Ok, so now our custom dialog is ready to be used. I invoke the custom dialog from a menu entry in the main windows as below, case IDM_MENU_CUSTOMDLG:     {         int ret = DialogBox(g_hInst, MAKEINTRESOURCE(IDD_CUSTOM_DIALOG), hWnd, CustomDialogProc);         switch(ret)         {             case IDC_BUTTON_BLACK_DEF:                 SetWindowText(g_hStaticSelection, L"You Selected: Black (default)");                 break;             case IDC_BUTTON_BLACK:                 SetWindowText(g_hStaticSelection, L"You Selected: Black");                 break;             case IDC_BUTTON_WHITE:                 SetWindowText(g_hStaticSelection, L"You Selected: White");                 break;         }         UpdateWindow(g_hStaticSelection);     }     break; So you see why ending the dialog with the corresponding value was important, that’s what the DialogBox() api returns with. And in the main window I update a static text label to show which option was selected. I cranked this out in about an hour, and unfortunately don’t have time for a managed C# version. That will have to be another post, if I manage to get it working that is (;

    Read the article

  • How to Place DialogBar or Dialog box into pane in vc 2008 or vc 2010 Beta

    - by gbalajimecse
    Hi now i am working in 2003 vc++ and i am converting(migrating) my project in to vc 2008 or new vc 2010 Beta,i saw the feature pack of 2008,2010 regards CDockable Pane(Auto Hode,floating),so i require this features ,i want to place a dialogbox or dialog bar into pane(CDockable Pane class), so i done this in my following code Myframe Code snippet is : if (!m_MyPane.Create(L"MyPane", this, CRect(0,0,0,0), true, IDD_DIALOG1, WS_CHILD|WS_VISIBLE)) return -1; AddDockSite(); EnableDocking(CBRS_ALIGN_ANY); EnableAutoHidePanes(CBRS_ALIGN_ANY); m_MyPane.EnableDocking(CBRS_ALIGN_ANY); DockPane(&m_MyPane, AFX_IDW_DOCKBAR_RIGHT); MyPane class Definition is : include "stdafx.h" include "Pane.h" include "Resource.h" include "MainFrm.h" include "soft1.h" ifdef _DEBUG undef THIS_FILE static char THIS_FILE[]=FILE; define new DEBUG_NEW endif CPane1::CPane1() { } CPane1::~CPane1() { } BEGIN_MESSAGE_MAP(CPane1, CDockablePane) ON_WM_CREATE() ON_WM_SIZE() END_MESSAGE_MAP() int CPane1::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; return 0; } void CPane1::OnSize(UINT nType, int cx, int cy) { CDockablePane::OnSize(nType, cx, cy); } when i build it wont shows any error and executed without error in the output the frame show the mypane but mypane didn't show IDD_DIALOG1 So is it anything am i missed please rectify my code and how to place a IDD_DIALOG1 dialogbox in to mypane PLEASE HELP ME REGARDS G.BALAJI

    Read the article

  • Synchronous Android activities

    - by rayman
    Ive made mis-leading topic in my last question, so i open this new question to clear what I realy want. sorry for the inconvenience. I wanna run two system(Android) activities one after another in specific order from my main activity. now as we know, startActivity is an asynchronous operation, so i cant keep on a specific order. so i thought maybe I should try to do it with dialogBox in the middle but also running a dialogBox is an asynchronous. now as i said the activities which i try to run are Android activities, so i cant even start them with startActivityForResult (or mybe i can, but i dont get any result back to my main(calling) activity) Any tricks how could i manage with this issue? Some code: first activity: Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(Settings.ACTION_APPLICATION_SETTINGS); startActivity(intent); second activity: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setDataAndType(Uri.fromFile(tmpPackageFile .getAbsoluteFile()), "application/vnd.android.package-archive"); startActivity(intent); as you can see, i dont have any access to those activites, i can just run thire intents from my main activity.

    Read the article

  • need help connecting to bitbucket repository with sourceTree on windows 8

    - by pythonian29033
    I'm having trouble adding and cloning my repo on bitbucket to the sourceTree app, we're only starting with this now and we're a small company, so there's not much knowledge around this. now I've gone through The documentation on sourceTree for help, but I've noticed when I select my repo on bitbucket, it uses the repo url I select and appends a .git at the end. Then a notice message says This is not a valid source path / URL, but when I click Details... I get a dialogBox with nothing in it and an ok button. and when I'm done entering the details the 'Clone' button remains disabled. Is this Windows 8 or am I actually doing something wrong? Now I usually use ubuntu, but we just got these new ASUS ultrabooks at work and it's a pain to install any linux Distro on here. So I'm stuck with windows 8

    Read the article

  • WatiN, VBScript

    - by little_devil
    I am using WatiN for my web tests. In one of my web pages, I have a VBScript function which opens a dialogbox. I am unable to access it using WatiN. I tried using WatiNTestRecorder; it was unsuccessful. I tried this also: http://blogs.dovetailsoftware.com/blogs/kmiller/archive/2008/07/16/scenario-testing-with-watin.aspx, unsuccessful again.

    Read the article

  • Windows7 Installer takes priority how to move it back during installation using C#?

    - by shahjapan
    I've a custom Action on Deployment project of .NET Applicaiton, which contains custom dialogbox to enter certain parameters, on invalid parameters I've shown MessageBox.Show - but its being hide by installer window, I tried windows forms too with Activate, TopMost, Focus,bring2front, etc serveral options but it comes by default behind the windows installer window and due to this user is not able to identify why installing process is not finishing - because actually its waiting for user to read the MessageBox and press OK. I've tried to implement IWin32Window with the handler of MsiExec Process, and shown the Messagebox but still its not working, anyone has idea ??? Here is my installer.cs function defination, public override void Install(IDictionary stateSaver)

    Read the article

1 2  | Next Page >