|
-
Feb 8th, 2006, 12:53 AM
#1
[RESOLVED] AppActivate in C#
What's the equivalent of it in C#? I tried searching but to no avail...
-
Feb 8th, 2006, 01:15 AM
#2
Re: AppActivate in C#
You could add the using Microsoft.VisualBasic; in the declarations section of your class. Then you will see the tooltip declaration just like before.
VB Code:
using Microsoft.VisualBasic;
'...
'...
AppActivate("VBForums - AppActivate in C# - Microsoft Internet Explorer");
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 8th, 2006, 01:29 AM
#3
Re: AppActivate in C#
There is no equivalent, as there isn't to any VB.NET Runtime functions. If there was a System-based equivalent then we'd all be using it in VB.NET too. I'd guess that AppActivate wraps the SetForeGroundWindow API (amongst others), because that's the only way to do it that I'm aware of in C#, short of what Rob suggested.
BTW Rob, you'd better hope that wossname doesn't see that post.
-
Feb 8th, 2006, 01:51 AM
#4
Re: AppActivate in C#
Oh, he wont. Remember that he got himself Banned. 
Plus, I did post that "you could" do it that way.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 8th, 2006, 02:45 AM
#5
Re: AppActivate in C#
Hmmmnnn... That's what I am afraid of, to resort to Microsoft.VisualBasic in C#... Will look into those API thingy first... Thanks guys!
-
Feb 8th, 2006, 04:06 AM
#6
Lively Member
Re: AppActivate in C#
I assume your trying to send text to a window.....
This maybe what your looking for. Just change the class window to whatever your sending text to
http://www.vbforums.com/showthread.php?t=380589
-
Feb 8th, 2006, 06:17 AM
#7
Re: AppActivate in C#
 Originally Posted by RobDog888
You could add the using Microsoft.VisualBasic; in the declarations section of your class. Then you will see the tooltip declaration just like before.
VB Code:
using Microsoft.VisualBasic;
'...
'...
AppActivate("VBForums - AppActivate in C# - Microsoft Internet Explorer");
You should be ashamed of yourself for even thinking that in the c# forum. If I had a sceptre, I'd banish you from this forum for a complete 19 minutes.
-
Feb 8th, 2006, 07:32 PM
#8
Re: AppActivate in C#
SetForeGroundWindow works if the app is not minimized, any tips on how to get it done when the app is minimized?
-
Feb 8th, 2006, 07:40 PM
#9
Re: AppActivate in C#
I would guess that you would have to use SetWindowPlacement to restore the window first, then call SetForegroundWindow to activate it. I've never used SetWindowPlacement though so I'm not 100% sure. Note that AppActivate will not restore a minimised window either.
-
Feb 8th, 2006, 07:46 PM
#10
Re: AppActivate in C#
Thanks 'spammer' , will dig into it...
-
Feb 8th, 2006, 08:00 PM
#11
Frenzied Member
Re: AppActivate in C#
You ever use Lutz Roeder's Reflector? I'm not sure if it's legal, so I won't post the code for AppActivate, but if you download the freeware, you can check out the code that makes up that method It's not trivial.
Mike
-
Feb 8th, 2006, 08:57 PM
#12
Re: AppActivate in C#
I have that issue before dee-u. Try to visit this link it works in my machine.
http://vbforums.com/showthread.php?t...light=activate
-
Feb 8th, 2006, 11:36 PM
#13
Re: AppActivate in C#
 Originally Posted by mar_zim
Thanks mar_zim...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|