473,503 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ 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 3395

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

Similar topics

0
369
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
7470
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
2670
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
1843
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
3046
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
4704
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
11081
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
2463
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
7064
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
7261
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
7315
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
6974
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
7445
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...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.