SendMessage API to autoclick save on a dialog?



Good day!


I just want to know on how to correctly use SendMessage API. When the save as dialog box popsup, Save button will be automatically click.  

Let say I have hwnd and classname value. Please see below



```
Public Declare Function SendMessage Lib "user32" Alias "SendMessageW" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Public DialogHWND As Long
Public ClassNameX as string

DialogHWND=1115400
classname="#31786"

Private Sun Command1_Click()
Dim lret As Long
lret = SendMessage(DialogHWND, BN_CLICKED, ClassNameX, Null)
End Sub

```

Thank you fe helping..!
Presumably the Save button will already have the focus, so why not just use SendKeys


SendKeys "{Enter}"


HTH,  

Rob
I suggest to use PostThreadMessage instead of SendMessage, check [PostThreadMessage Demystified](http://www.codeproject.com/Articles/225755/PostThreadMessage-Demystified)[[^](http://www.codeproject.com/Articles/225755/PostThreadMessage-Demystified "New Window")] for reasons. For Documentation see <http://msdn.microsoft.com/en-us/library/windows/desktop/ms644946%28v=vs.85%29.aspx>[[^](http://msdn.microsoft.com/en-us/library/windows/desktop/ms644946%28v=vs.85%29.aspx "New Window")]  

  

And by the way if you want to invoke a function of your dialog class from your thread, then you need to send the "this"(present dialog object reference) as a parameter to the thread procedure. Are you sure you are doing this? Because in the code you are casting you lParam into an int which baffles me. When you call your threadproc you need to send "this" as "lParam".  

With SendMessage the code would look something like :   


```
 void ThreadProc(LPVOID lParam)
{
   CCurrentDialog* pDlg = (CCurrentDialog*)lParam;
   SendMessage(pDlg->m\_hWnd,ON\_CBN\_SELCHANGE,NULL,NULL);
}
```
  

  

You can use [PostMessage](http://msdn.microsoft.com/en-us/library/windows/desktop/ms644944%28v=vs.85%29.aspx)[[^](http://msdn.microsoft.com/en-us/library/windows/desktop/ms644944%28v=vs.85%29.aspx "New Window")] also. can you be a little more precise ? does your send message work corretctly if sent from main procedure ? if yes do you uses qmhsndpm ? who is the receiver (call stack entry) (I suppose it’s ‘*’) ? what level in the stack (call stack count)(I suppose it’s 2 ) ?





A message subfile displays the messages from a program message queue — that’s what they’re for. Normally, they’re linked to the name of the program that displays the message subfile (i.e., displays the display file).


Send a message to the program message queue that’s associated with the message subfile.


Tom First you need to clear the call in the database. `$mysqli->query`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

sent request before parameter binding, etc.


Replace as follows:



```
$stmt = $mysqli->prepare('SELECT reply\_id FROM replies WHERE reply\_topic = ? ORDER BY reply\_date ASC');
$stmt->bind_param('i',$param)
$stmt->execute();

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

 `$mysqli->prepare`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

returns a new object for which you want to bind values ​​and execute them. It avoids [SQL injection](https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=) !


None of this is discounted. `mysqli_`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

is exactly what you should be using.



  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

Since all you need is an array of results, you can use the following code to do this - no custom functions are required.



```
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
        $set[] = $row['reply\_id'];
}

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

For each row, `while`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

each field is stored in an array with the column name as the key. Thus, `$row['reply_id']`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

contains the value of a column `reply_id`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

in the database. Above, I have stored this value in a named array `$set`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

and when it iterates over the next row of the result, it also stores the next value for that array.


You can manipulate the result before or after saving it to a new array as you see fit.


Hope it helps. hi sergey sugak, - - here is a sample which shows how to use close() method: - - - telerik:radmenu id=radmenu1 runat=server> -     items> -         telerik:radmenuitem text=root item> -             items> -                 telerik:radmenuitem value=tempbutton> -                     itemtemplate> -                         asp:button id=button1 text=click onclientclick='closeitem(tempbutton)'  runat=server /> -                     itemtemplate> -                 telerik:radmenuitem> -             items> -         telerik:radmenuitem> -     items> - telerik:radmenu> - - - and the closeitem function: - - - text/javascript> -     function closeitem(val) { -         alert(1); -         var menu = $find(); -         menu.finditembyvalue(val).get\_parent().close(); -         return false; -     } - - - - - best regards, - yana - the telerik team - - - do you want to have your say when we set our development plans? - do you want to know when a feature you care about is added or when a bug fixed? - explore the - - telerik public issue tracking - system and vote to affect the priority of the items. - Hello Dmytro,


You will need to bind to the Custom Command, create arguments for the command execution, specify parameter values that will be used to execute the command in the Scheduled Task and then pass the arguments to the Arguments property of the action. Here is the code that will do the trick:



```
# Define actions and conditions for the task

$commandID = "{a7264a61-b77d-4386-a138-ec2557c5b3ba}" # Command ID
$commandDN = "CN=MyCommand,CN=Custom Commands,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes" # Command DN

# Create action set
$actionsAndConditions = $task.ConditionedActions.Create()
$actionsAndConditions.ConditionsLogicalOperation = "ADM_LOGICALOPERATION_AND"
$actionsAndConditions.SetInfo()

# Create execute Custom Command action
$action = $actionsAndConditions.Actions.CreateEx("adm-CustomCommandAction")
$action.ExecutionOptions = "ADM_ACTIONEXECUTIONOPTIONS_SYNC"

# Get action
$removeAction = $action.GetAction()

# Bind to Custom Command
$customCommand = $Context.BindToObjectByDN($commandDN)

# Specify command arguments
$arguments = $customCommand.CreateArguments()
$arguments.SetParameterValue("MyParameter", "MyValue") # Parameter value

# Configure the action
$removeAction.CustomCommandId = $commandID
$removeAction.Arguments = $arguments

# Save action
$action.SetAction($removeAction)
$action.SetInfo()
```

In the script, the $commandDN variable specifies the distinguished name (DN) of the Custom Command. For information on how to get the DN of a directory object, see <http://adaxes.com/sdk/?HowDoI.GetDnOfObject.html>.


For details, have a look at the following SDK article: <http://adaxes.com/sdk/?IAdmCustomCommandAction2.html>. hi chris, 
if you use relations api, you may set properties field in your query. in this field you should set the names of the properties which values must be retrieved from the server. the argument should be a string in the following format: "propertyname1, propertyname2, , , propertynamen" , wher… hi

we can do that by defining a string variable in the very beginning of the process with assign activity or by defining that in variable panel in the studio at the bottom the window

but make sure that we are not assigning any value to that variable later across the workflow

if we assign later th… Hi Romain, 

  
  
You can use HTML formatting this way:

  
  

```
  
sender = scenario.get_message_sender(channel_id="my_channel_id")   
sender.set_params(sender="dss@company.com",   
                recipient="your.email@company.com",   
                sendAsHTML=True)  
                  
html_message="<b>All is good</b>"  
  
sender.send(subject="The scenario is doing well",   
            message=html_message)
```
  
  
 




[View solution in original post](/t5/Using-Dataiku/Is-it-possible-to-send-custom-reports-as-HTML/m-p/2194#M1517) [@rbarriuso](/u/rbarriuso), to set script response from an async operation use the method below…

event.setresponse(content, statuscode, contenttype)

so in your case it will be like …

myapi.authentication

.login("mylogin", "mypassword")

.then(function(result) {

console.log("auth correct: ", result);

var c… You can use the XPATH syntax:



```
var span = doc.DocumentNode.SelectSingleNode("//span[@class='dropDownButton ownCity coords']");
var anchorText = span.ChildNodes["a"].InnerText;

```

You can also use LINQ:



```
var anchorTexts = 
    from span in doc.DocumentNode.Descendants("span")
    where span.GetAttributeValue("class", "") == "dropDownButton ownCity coords" 
    from anchor in span.Descendants("a") 
    select anchor.InnerText;
string anchorText = anchorTexts.FirstOrDefault();

```