473,473 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Windows Messenger - Receive text flash, Accept file transfer, threading issues

[Information previously posted on microsoft.public.livecomm]

I need urgent help. Done OK for a newbie getting automation of Windows
Messenger into a Winform C# app but have three problems that I
urgently need pointers to. Point 1 and 2 are the same issue, I think.
Point 3 might relate to a threading issue:

1. I have written a C# Winform application that uses Windows messenger
automation.
When I attempt to send a file through the window messenger object,
there is some horrid screen flicking because a file selection dialog
briefly shows (and I use send keys to auto select the file). Also
there is another flick because the instant messenger chat window pops
up (and then I need to close within code). There seems no way to set
any visible property or use a "hide" method. to prevent all of this.
Does anyone have any ideas how to prevent the quick flashes that
occur. It might be that I need some API handling of the windows and
send messages?? My code below:
---------------------------------------------------------------
msn = new MessengerAPI.MessengerNativeClass();
//MessengerAPI.IMessengerWindow messengerWindow = null;
//messengerWindow = (MessengerAPI.IMessengerWindow)msn.Window;
//messengerWindow.Close();

msn.SendFile(m_user.EmailAddress , "C:\\MyTest.zip");
System.Windows.Forms.SendKeys.Send("{ENTER}"); //to select the file
selection dialog that pops and close it

MessengerAPI.IMessengerConversationWnd InstmessengerWindow =null;
InstmessengerWindow = (MessengerAPI.IMessengerConversationWnd)
msn.InstantMessage(m_user.EmailAddress);
InstmessengerWindow.Close(); //to close the Instant messenger chat
window

---------------------------------------------------------------
2. I am trying to accept invites for file transfer from a remote user
(again using Windows Messenger object).
The messenger objects 'OnFileTransferInviteReceived' event is raised
(and code enters my event handler method) but I am not able to accept
the file transfer programatically. The instant messenger chat window
opens
prompting me to Accept the file tranfer. How can this be achieved
programatically without Windows messenger client user interfaces
appearing?
Again this might be some API level coding - like getting a handle on
the Instant messenger object AND then the chat window that has been
created (but is not visible until the eventhandler has been exited??
3. When a text message has been received and the code enters my event
handler method to handle this, if I try and load a property grid
control with the data in the message, I get the error "Unable to
populate a control created in another thread". If I re-send the
message a second time, this populates the grid no problem. Although
thre must be some lower level issue as down the line when working with
the app, it freezes. Looking at the threads
information(Debug/Windows/Threads) when I am in the method to handle
the event, the thread is different to that for the main form. Any
ideas how to handle this. From within the method, can I do something
like a thread join??
Hope someone can assist me with these urgent problems.

Thanks

Grant
Jul 21 '05 #1
0 3388

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: GrantS | last post by:
I need urgent help. Done OK for a newbie getting automation of Windows Messenger into a Winform C# app but have three problems that I urgently need pointers to. Point 1 and 2 are the same issue, I...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
2
by: domtam | last post by:
Hi there. My goal is to write a windows service that can act as HTTP Request server. How can I do that? I know that I can use ASP.NET to develop a web site to achieve this purpose, i.e....
9
by: schuetz | last post by:
Hi @ll, I'm working on a web project which has to use multiple channels to connect to receive several sources at once. The problem is, that I'm not aware of the maximum amount of Threads i can...
5
by: prognoob | last post by:
I have searched online, and what I mostly come across is what these security issues are... for example, Worms, Backdoor Trojan Horses, Hijacking and Impersonation, Denial of Service etc. but I...
5
by: eliasen | last post by:
Hi I have created a Windows Service using C# and .NET2.0. The service is quite simple - right now it doesn't do anything except throwing an exception in the OnStart method. It used to something...
4
by: DudDav | last post by:
Hi All, I have been trying to configured WebDAV on our current IIS server as an alternative to FTP and have had some mixed success but I've hit a brick wall with one problem. The server...
3
by: aagarwal8 | last post by:
Hi, I have a main form, which i use to open secondary forms. From the secondary form i need to open a Modal Window in such a way that, my secondary form is blocked, but i can still access my...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.