Disabling "Next" button In InstallScript - installshield

Using InstallShield - InstallScript project:
I made a custom dialog for browsing for a file.
On the dialog initialization I want to disable the "Next" button.
I am successful in disabling other buttons on this dialog except for any of the buttons of the install wizard: Cancel, Next and Back.
I used the functions _WinSubEnableControl or EnableWindow.

It works for me:
function
HWND hwndDlg, hwndNext;
...
begin
...
hwndDlg = CmdGetHwndDlg( strDialogName );
hwndCtrl = GetDlgItem(hwndDlg, NEXT);
EnableWindow(hwndCtrl, FALSE);
...
end;
If you didn't find this useful, please publish your code.

The code for disabling the button should be after the call to SdGeneralInit.
If you put it before (like I did) the change won't stick.
The call to SdGeneralInit explicitly enables the "Next" button, that is why it did not work for the "Next" button but did work for the other custom buttons on the dialog.
It should look something like that:
case DLG_INIT:
SdGeneralInit( szDlg, hwndDlg, 0, szSdProduct );
hDlgHandle = CmdGetHwndDlg(szDlg);
hNextButton = GetDlgItem(hDlgHandle, 1); // 1 is the id for the next button.
EnableWindow(hNextButton, FALSE);

Related

Need help in GMS2 pls, trigger works again and save menu opens again, even though it should just close

I've run into this problem.
I have a save menu with two options: "Save" and "Return", which is selected by the option heart. When selecting the "Return" option, the option arrow going back to "Save" even though it should close the save menu(It seems that when menu is closing, the trigger works again and menu opens again, even though it should just close).
The second problem is that when you select the "Save" option, the "File saved" window appears, after which it does not disappear when im pressing "Z" key, and I do not understand what is the reason for these two errors, no matter how I tried to fix them.
It seems that I write the code correctly, but nevertheless it does not work.
Key Press "Z" Event:
if image_index = 0
{
instance_change(obj_saveconfirm, true);
audio_play_sound(snd_save, 10, false);
}
else {
if image_index = 1
{
instance_destroy();
}
}
Code that opens the save menu:
if place_meeting(x, y, obj_player) && keyboard_check_pressed(ord("Z")) && !instance_exists(obj_savemenu) && !instance_exists(obj_saveconfirm)
{
instance_create_depth(x, y, -9999, obj\_savemenu);
}
It seems that I write the code correctly, but nevertheless it does not work.
I also used "keyboard_check_released" in code that opens the save menu, and menu is closing, but after half a second it opens again.

click on button which appears sometime on screen using python selenium

I am working automating website which generates quotations for mixer selection, sometimes for some parameters list of mixers suggested is more than 5 then Next button appears below the list. This button shown on the screen only when mixer list is more than 5.
below code I am using to save screenshot of the page and I want to screenshot of page which will come after click on Next button whenever it is available.
name = str(worksheet.cell_value(1,1))+"_"+str(worksheet.cell_value(1,2))+"_"+str(worksheet.cell_value(1,3))+\
"_"+str(worksheet.cell_value(1,4))+str(worksheet.cell_value(1,5))+".png"
driver.save_screenshot("D:\Automation\Pycharm_project\MRMix\Screenshots\%s"%name)
Lets say if next button is displayed, then need to click on it and need to take screenshot. You can simply try like below (in java)
you can have small method to return true or false depends on next button display
boolean isNextDisplay=false;
try {
if(driver.findElement(By.id("nextButton")).isDisplayed()==true) {
isNextDisplay=true;
}
}catch (Exception e) {
System.out.println("next button not displayed");
}
depends on display, click on next button and take screenshot.
if(isNextDisplay==true) {
//click on next button
//take screenshot
}
instead of methods, you can straightway write it. in Try >>If >> click and take screenshot

Click OK in Dialog box display output text in SDI

I have a dialog box displayed when I press a menu item in the SDI window. In the Dialog box When i press OK button it should display "SUCESS" in the SDI window... In ONVIEW() i have to use pDC->TEXTOUT() but how to execute that statement on pressing OK button.. I am using visual C++ 6
you should define a user defined message and use PostMessage to call your method in SDI Window.
I am working on assumption that your dialog is modal.
You do not have to define or send any messages.
Retrieve data from the dialog.
Presumably you store 2D vector data in some kind of an array declared as a member variable of the dialog.
When OK button is pushed and copy data to a view’s member variable of the same type. Use it to draw whatever you desire.
void CSDIPopupSampleView::OnViewDialog()
{
CSimpleDlg dlg;
int iResponse = dlg.DoModal();
if(IDOK == iResponse)
{
//Copy data from a dialog here.
}
Invalidate(); // this will cause redraw
}

Hold-Hover drop down menu Delay Time

Im creating a drop down menu and i want to know if there is anyway to implement the following:
I need to keep the sub-menu open for like 1 sec if the user moves the mouse away from the tab he selected. Much likely like in current intel web page www.intel.com , here u hover over menu, but if u take the mouse away from the tab or the sub-menu is opens it takes a few to hide the sub menu.
Im using .mouseover from jquery to show the menu (a div) but i cant find a way to make it stay for a few moments.
Thanks in advance
This may be of service
What is the JavaScript version of sleep()?
If you want to do something in the interim setTimeout() takes the arguments as shown where continue execution is another subroutine. If you just want this one tab to work this way have mouseover call doStuff and set a boolean (e.g. mouseStillIn) to TRUE. When the mouse exits set this boolean to FALSE, call a recursive function everytime mouseStillIn is TRUE.
e.g.
var mouseStillIn : boolean = false;
function MouseIn()
{
mouseStillIn=true;
CheckMouse();
}
function CheckMouse()
{
if(mouseStillIn)
{
setTimeout(CheckMouse, 1000);
}
}
function MouseOut()
{
mouseStillIn=false;
}

Setting command button visibility in VC++ 6.0?

How can I make the command button in my VC++ 6.0 dialog visible or invisible on load?
From the resource editor once you select the button, you can see its properties in the properties window. Here you can set the visible property to true / false. (assuming this functionality is present in 6.0 - i use 2003 now and cannot remember if this used to be present in 6.0)
Add CButton variable
If you want to dynamically change the buttons visibility during load, add a variable for your button using the MFC class wizard. (you are lucky to have this - this wizard seems to have been removed from Visual Studio .NET)
Override CDialog InitDialog
Next override the initdialog function of your dialog box and then once the base InitDialog function has been successfully called, set the buttons showwindow property to SW_HIDE / before showing the dialog box.
Code
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
if (ConditionShow)
m_MyButton.ShowWindow(SW_SHOW);
else
m_MyButton.ShowWindow(SW_HIDE);
return TRUE;
}
You can also do it without adding a CButton variable - just call
In the OnInitDialog method of the window containing the button/control, put in code:
CWnd *wnd = GetDlgItem (YOUR_RESOURCE_NAME_OF_THE_BUTTON)
wnd->ShowWindow(SW_SHOW) or SW_HIDE
What do you mean by 'commnad button' exactly ?
Anyway, you need to obtain the handle of the button then call ShowWindow function:
BOOL prevState = ShowWindow( itemHandle, SW_HIDE );
Only use
ShowDlgItem(Your_DLG_ITEM_ID,1); // visible = true
ShowDlgItem(Your_DLG_ITEM_ID,0); // visible = false

Resources