Send a message to a message subfile




 Nitin wrote in with this question recently:

"How can I send a message to a message subfile from a sub procedure that is called from main procedure."

Do you know how this can be done? 

-- Debra Tart, associate editor, Search400.com
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
[image] palaniyappan:

hi

welcome to uipath community

yah ofcourse

we can use send smtp mail activity or send outlook mail activity or send exchange mail activity to send the mail with screenshot image file, where in attach file option we can mention the file path of the image we took using ta… 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. Not normally. You can call the facility and speak to a counselor or case manager and ask nicely if they will relay a message. The rules are usually against this, but if you ask nicely, they might pass along your urgent message. Call statement Transfers control to a Sub procedure, Function procedure, or dynamic-link library (DLL)procedure.



I believe that you cannot use "CALL" to call a file which is not executable.  

same goes with SHELL...



Call Shell(AppName, 1) Where AppName contains the path of the Executable file.



try it with any other directory and try calling an executable.. it will work.



If you try calling a .txt or .bmp, it will give you the same error message... hi [@prepetti](/u/prepetti),

try the send hotkey . it showing the context menu,

[image]

file : [excel.zip](https://aws1.discourse-cdn.com/uipath/original/3x/6/b/6b8e341a2c0952e41bb5c6738e513b77072e2268.zip) (1.7 kb)

regards

balamurugan. http://community.spiceworks.com/help/how\_do\_i\_send\_spiceworks\_my\_log\_files%3f hi [@juan\_esteban\_valencia](/u/juan_esteban_valencia)

i think in the attachment section

we had to add the complete filepath of the file which we need to send not the folder path only

regards

nived n :robot:

happy automation :relaxed::relaxed::relaxed: Please create an account and send us a private message with the detailed project requirements here -> <https://cpentalk.com/message/cpentalk>  
  
Best regards! Try this [Click Here](http://xahlee.info/php/send_mail_attachment.html) re: help<br><br>you need to get the documents scanned in and sent through to our offices.