View previous topic :: View next topic |
Author |
Message |
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Dec 10, 2006 2:51 pm Post subject: Hook APIs |
|
|
Hello all,
Does anybody know if it is possible to hook on to API calls made by other programs, so you can "listen" to what they do? I am thinking about trying to create a kind of X-window system, just like it exists on Linux/Unix. Basicly I just want to capture the calls to all DLLs which have something to do with screen output, send them to another computer which will then call the same functions so you can remote-control applications over the internet or any other network.
I tried to do the above with the use of GadgetX' SetMsg functions, but couldn't get it to work. My ultimate goal (if it is possible at all) is to create a webbased interface so you can use applications which are installed at your computer at home anywhere in the world... _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Dec 10, 2006 3:29 pm Post subject: |
|
|
Hey Skit,
To my knowledge, which may be incorrect, it is only possible to "Hook"
messages from an external dll. My ssmenu.dll uses a hook procedure to
capture menu events and then generate the appropriate menu item event.
I may not be understanding your need however. DragonSphere would
more than likely have the correct answer for you. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
webdaddy Contributor
Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Mon Dec 11, 2006 11:56 pm Post subject: DLL Hooking |
|
|
I used to use something call DLLSPY but I dont know where I got it. I will look as see if I can find it and if it will do what your looking for. I too believe you can only hook into DLL's and not exe's.
WD _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
Back to top |
|
|
ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Dec 12, 2006 12:57 am Post subject: Re: DLL Hooking |
|
|
webdaddy wrote: | I too believe you can only hook into DLL's and not exe's.
WD |
I may not have explained correctly. What I meant to say was that a hook
procedure (function), can only be executed from within a .dll. The hook
procedure however can monitor messages for all windows/controls or
just specific windows/controls depending on how it is programmed. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Dec 12, 2006 3:07 pm Post subject: |
|
|
Skit,
GadgetX'es Message API hooks only work with the following types of Message API hooks WH_GETMESSAGE and WH_CALLWNDPROC. Also they only work with the program that loads and calls the GadgetX message API commands/functions. They will not allow you to hook messages being sent to and from other applications. The reason for this is that I use the current thread in the process that called them. Anyway this area of GadgetX was planned for a overhaul in this latest build but I ran out of time and decided to focus my energy on more modern technology to add too VDS. I will give you a hint though... Technically it is possible to use the CallBack functions in GadgetX to access the other 5 or 6 Window Hook procedures.
At any case it does not sound like this is what you are looking for You are actually looking for a DLLSPY like what webdaddy posted about above. Personally I would not allow such a program on my system. It can too easily be misused. Most software today guard against such programs anyway. Besides to build a X-Windows type interface for Windows you would not need a program that spys on every program. There are other X-Windows shells for Windows that you should be able to take a look at to get a general idea of how to build them. Garrett and I have come very close at various times to building a full Windows shell replacement. However my knowledge of windows programming was lacking back in those days and I could not get the system tray to work like we wanted it too.
Also it is possible to host the Remote Desktop Client of Windows 2000 and Windows XP on a VDS dialog using GadgetX. I have done this before if you are just looking to build a program that can give you a remote desktop this is possible using GadgetX'es ActiveX abilities. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
jwfv Valued Contributor
Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Tue Dec 12, 2006 5:01 pm Post subject: |
|
|
Dragonsphere:
I use remote desktop quite a bit and would be interested in knowing more about how this can be done with GadgetX in VDS. Is it an ActiveX control? _________________ Joe Floyd |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Dec 12, 2006 5:21 pm Post subject: |
|
|
jwfv wrote: | Dragonsphere:
I use remote desktop quite a bit and would be interested in knowing more about how this can be done with GadgetX in VDS. Is it an ActiveX control? |
Yes Remote Desktop has a ActiveX interface that comes with it. I may do a demo of this however the full Registered user's install is almost 2MBytes now so I don't think I will be able to keep adding demos to the install. I don't want to make it so big that it takes forever to download. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
jwfv Valued Contributor
Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Tue Dec 12, 2006 5:26 pm Post subject: |
|
|
Cool - let me know if you do a demo of it. I would definitely be interested in taking a look at that. _________________ Joe Floyd |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Dec 12, 2006 6:37 pm Post subject: |
|
|
I know of Remote Desktop, but my idea was to capture all individual windows after which you can put them on "workspaces" just like with Linux. One thing for which it can be used, is to set up a Windows machine as a kind of terminal server, and use other machines as clients, so that the core program runs on one computer and the GUI on several others.
Well, if it isn't easy possible to do, I'll just abandon the idea. But first I'll look into a DLLSPY tool, if I can find any _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Jul 11, 2008 8:09 pm Post subject: |
|
|
jwfv wrote: | Cool - let me know if you do a demo of it. I would definitely be interested in taking a look at that. |
Joe,
I finally got the RDP Web Client to work with GadgetX. We use non-standard ports here at work now and I could not find the method that sets the IP port number until recently when MS updated their online MSDN documentation for RDP. Below is a demo showing how to embed RDP into a VDS dialog.
Code: |
#-----------------------------------------------------------------------------#
# #
# Demo of using the MS RDP Web ActiveX client with VDS/GadgetX #
# #
# Author: Johnny Kinsey #
# #
# Copyright: Copyright © 2008 DragonSphere Software All Rights Reserved. # #
# #
#-----------------------------------------------------------------------------#
OPTION DECIMALSEP,.
Title Create Object Examples
If @Greater(@Name(@SYSINFO(DSVER)),4)
External GadgetX.dll,@SysInfo(DSVER)
# GadgetX Commands
#DEFINE COMMAND,GadgetX,DEFINE,OLE,Set,FIREEVENT
# GadgetX Functions
#DEFINE FUNCTION,GadgetX,OLE,Get
Else
Warn This Example uses VDS 5 or above syntax.
Stop
End
# Below is an example of Micro$oft Terminal Services Active Client 1.0 Type Library that show how
# to create the MSTSCLib object and place it on a VDS Dialog
# The following line is required
Ole Init
# The following line is optional
# it is here for debugging your script
Ole Exceptions,SHOW
# Micro$oft Terminal Services Active Client 1.0 Type Library
Define Variable,Object,MSTSCLib
Define IID,IMsTscAxEvents,{336D5562-EFA8-482E-8CB3-C5C0FC7A7DB6}
# Map a user defined VDS Event Name to a Member ID for IMsTscAxEvents
# Define EventMap,IMsTscAxEvents,OnConnecting,1
# Define EventMap,IMsTscAxEvents,OnConnected,2
# Define EventMap,IMsTscAxEvents,OnLoginComplete,3
Define EventMap,IMsTscAxEvents,OnDisconnected,4
Define EventMap,IMsTscAxEvents,OnEnterFullScreenMode,5
Define EventMap,IMsTscAxEvents,OnLeaveFullScreenMode,6
# Define EventMap,IMsTscAxEvents,OnChannelReceivedData,7
# Define EventMap,IMsTscAxEvents,OnRequestGoFullScreen,8
# Define EventMap,IMsTscAxEvents,OnRequestLeaveFullScreen,9
# Define EventMap,IMsTscAxEvents,OnFatalError,10
# Define EventMap,IMsTscAxEvents,OnWarning,11
# Define EventMap,IMsTscAxEvents,OnRemoteDesktopSizeChange,12
# Define EventMap,IMsTscAxEvents,OnIdleTimeoutNotification,13
# Define EventMap,IMsTscAxEvents,OnRequestContainerMinimize,14
# Define EventMap,IMsTscAxEvents,OnConfirmClose,15
# Define EventMap,IMsTscAxEvents,OnReceivedTSPublicKey,16
# Define EventMap,IMsTscAxEvents,OnAutoReconnecting,17
# Define EventMap,IMsTscAxEvents,OnAuthenticationWarningDisplayed,18
# Define EventMap,IMsTscAxEvents,OnAuthenticationWarningDismissed,19
# Define EventMap,IMsTscAxEvents,OnRemoteProgramResult,20
# Define EventMap,IMsTscAxEvents,OnRemoteProgramDisplayed,21
# Define EventMap,IMsTscAxEvents,OnLogonError,22
# Define EventMap,IMsTscAxEvents,OnFocusReleased,23
# Define EventMap,IMsTscAxEvents,OnUserNameAcquired,24
#
Parse "%%DeskTTop;%%DeskTLeft;%%DeskTWidth;%%DeskTHeight",@sysinfo(DESKTOPRECT)
%%classname = #RDPC
DIALOG CREATE,VDS RDP Client,-1,0,1024,768,CLASS RDPC,RESIZABLE
GadgetX Add,Ole,MSTSCLib,%%classname,0,0,1024,768,{7584c670-2274-4efb-b00b-d6aaba6d3850},NULL
DIALOG SHOW
# Connect to the Event Interface
%%token = @Ole(ConnectEvents,MSTSCLib,IMsTscAxEvents)
# propery Desktop width
Ole Set,MSTSCLib,"DesktopWidth = ^d",1024
# propery Desktop Height
Ole Set,MSTSCLib,"DesktopHeight = ^d",768
Ole Set,MSTSCLib,"ColorDepth = ^d",24
Ole Set,MSTSCLib,"FullScreen = ^b",False
# property Server
Ole Set,MSTSCLib,"Server = ^B",192.168.0.1
Ole Set,MSTSCLib,"Domain = ^B",<Optional>
# property UserName
Ole Set,MSTSCLib,"UserName = ^B",<A>
Ole Set,MSTSCLib,"AdvancedSettings.RDPPort = ^d",<TCP>
Ole Set,MSTSCLib,"AdvancedSettings.RedirectDrives = ^b",True
Ole Set,MSTSCLib,"AdvancedSettings.RedirectPrinters = ^b",True
Ole Set,MSTSCLib,"AdvancedSettings.RedirectPorts = ^b",True
# Method Connect
Ole Call,MSTSCLib,Connect
# Wait until the client is connected before going forward
While @Null(@Ole(Get,MSTSCLib,^w,"Connected"))
wait 1
Wend
# Used as a switch to determine when our VDS host dialog status is maximized.
%%ismax =
:evloop
Repeat
wait event,0.3
%E = @event()
If %E
GoSub %E
End
Until @Equal(%E,CLOSE)
Exit
:TIMER
# If the user maximizes our VDS host dialog
# tell the RDP client to go full screen.
If @Equal(@winpos(%%classname,S),3)
%%ismax = 1
Ole Set,MSTSCLib,"FullScreen = ^b",True
End
Exit
:RESIZE
:PAINT
If @Null(%%ismax)
# A RDP session cannot be resized once connected
# so force our client window to stay the same size.
DIALOG SETPOS,,,,1024,768
End
Exit
:CLOSE
# The lines below are required to be called
# before your script exits
If @Get(MSTSCLib)
# Method Disconnect
If @Ole(Get,MSTSCLib,^w,"Connected")
Ole Call,MSTSCLib,"Disconnect"
While @Ole(Get,MSTSCLib,^w,"Connected")
wait 1
Wend
End
# Must be called before your program exits
Ole DisConnectEvents,MSTSCLib,IMsTscAxEvents,%%token
# Remove the object from the Dialog
Ole Remove,MSTSCLib,%%classname
# Free the Object variable
Ole Free,Object,MSTSCLib
End
# The following line is required to be
# the very last executed line in your script
Ole UnInit
Exit
:IMsTscAxEventsOnConnecting
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnConnecting event was fired
Exit
:IMsTscAxEventsOnConnected
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnConnected event was fired
Exit
:IMsTscAxEventsOnLoginComplete
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnLoginComplete event was fired
Exit
:IMsTscAxEventsOnDisconnected
# The next line will extract the event parameter
%%discReason = @Ole(EventParamsList,IMsTscAxEventsOnDisconnected)
If @Greater(%%discReason,1)
# The user did something to close the session so
# we will close our VDS client application.
FireEvent CLOSE
End
Exit
:IMsTscAxEventsOnEnterFullScreenMode
# The event was fired
##Dialog Set,Status1,Entered full screen mode...
Exit
:IMsTscAxEventsOnLeaveFullScreenMode
# The user has left Full Screen mode
# so change our VDS host application dialog to return
# to the non-maximized size.
WINDOW NORMAL,%%classname
%%ismax =
Exit
:IMsTscAxEventsOnChannelReceivedData
# The next lines extract the event parameters
# The parameters are comma separated
# Save the current field separator
%%OldSep = @fsep()
# Change the field separator to a comma
Option FieldSep,@chr(44)
# Use Parse to separate the parameters into VDS variables
Parse "%%chanName;%%data",@Ole(EventParamsList,IMsTscAxEventsOnChannelReceivedData)
# Now do something really cool with the parameters
# %%chanName;%%data
# Change the field separator back to the original
Option FieldSep,%%OldSep
Exit
:IMsTscAxEventsOnRequestGoFullScreen
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnRequestGoFullScreen event was fired
Exit
:IMsTscAxEventsOnRequestLeaveFullScreen
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnRequestLeaveFullScreen event was fired
Exit
:IMsTscAxEventsOnFatalError
# The next line will extract the event parameter
%%errorCode = @Ole(EventParamsList,IMsTscAxEventsOnFatalError)
# Now do something really cool with the parameter
#Dialog Set,Status1,%%errorCode
Exit
:IMsTscAxEventsOnWarning
# The next line will extract the event parameter
%%warningCode = @Ole(EventParamsList,IMsTscAxEventsOnWarning)
# Now do something really cool with the parameter
#Dialog Set,Status1,%%warningCode
Exit
:IMsTscAxEventsOnRemoteDesktopSizeChange
# The next lines extract the event parameters
# The parameters are comma separated
# Save the current field separator
%%OldSep = @fsep()
# Change the field separator to a comma
Option FieldSep,@chr(44)
# Use Parse to separate the parameters into VDS variables
Parse "%%width;%%height",@Ole(EventParamsList,IMsTscAxEventsOnRemoteDesktopSizeChange)
# Now do something really cool with the parameters
# %%width;%%height
# Change the field separator back to the original
Option FieldSep,%%OldSep
Exit
:IMsTscAxEventsOnIdleTimeoutNotification
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnIdleTimeoutNotification event was fired
Exit
:IMsTscAxEventsOnRequestContainerMinimize
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnRequestContainerMinimize event was fired
Exit
:IMsTscAxEventsOnConfirmClose
# The next line will extract the event parameter
%%pfAllowClose = @Ole(EventParamsList,IMsTscAxEventsOnConfirmClose)
# Now do something really cool with the parameter
#Dialog Set,Status1,%%pfAllowClose
Exit
:IMsTscAxEventsOnReceivedTSPublicKey
# The next lines extract the event parameters
# The parameters are comma separated
# Save the current field separator
%%OldSep = @fsep()
# Change the field separator to a comma
Option FieldSep,@chr(44)
# Use Parse to separate the parameters into VDS variables
Parse "%%publicKey;%%pfContinueLogon",@Ole(EventParamsList,IMsTscAxEventsOnReceivedTSPublicKey)
# Now do something really cool with the parameters
# %%publicKey;%%pfContinueLogon
# Change the field separator back to the original
Option FieldSep,%%OldSep
Exit
:IMsTscAxEventsOnAutoReconnecting
# The next lines extract the event parameters
# The parameters are comma separated
# Save the current field separator
%%OldSep = @fsep()
# Change the field separator to a comma
Option FieldSep,@chr(44)
# Use Parse to separate the parameters into VDS variables
Parse "%%disconnectReason;%%attemptCount;%%pArcContinueStatus",@Ole(EventParamsList,IMsTscAxEventsOnAutoReconnecting)
# Now do something really cool with the parameters
# %%disconnectReason;%%attemptCount;%%pArcContinueStatus
# Change the field separator back to the original
Option FieldSep,%%OldSep
Exit
:IMsTscAxEventsOnAuthenticationWarningDisplayed
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnAuthenticationWarningDisplayed event was fired
Exit
:IMsTscAxEventsOnAuthenticationWarningDismissed
# The event was fired
#Dialog Set,Status1,IMsTscAxEventsOnAuthenticationWarningDismissed event was fired
Exit
:IMsTscAxEventsOnRemoteProgramResult
# The next lines extract the event parameters
# The parameters are comma separated
# Save the current field separator
%%OldSep = @fsep()
# Change the field separator to a comma
Option FieldSep,@chr(44)
# Use Parse to separate the parameters into VDS variables
Parse "%%bstrRemoteProgram;%%lError;%%vbIsExecutable",@Ole(EventParamsList,IMsTscAxEventsOnRemoteProgramResult)
# Now do something really cool with the parameters
# %%bstrRemoteProgram;%%lError;%%vbIsExecutable
# Change the field separator back to the original
Option FieldSep,%%OldSep
Exit
:IMsTscAxEventsOnRemoteProgramDisplayed
# The next lines extract the event parameters
# The parameters are comma separated
# Save the current field separator
%%OldSep = @fsep()
# Change the field separator to a comma
Option FieldSep,@chr(44)
# Use Parse to separate the parameters into VDS variables
Parse "%%vbDisplayed;%%uDisplayInformation",@Ole(EventParamsList,IMsTscAxEventsOnRemoteProgramDisplayed)
# Now do something really cool with the parameters
# %%vbDisplayed;%%uDisplayInformation
# Change the field separator back to the original
Option FieldSep,%%OldSep
Exit
:IMsTscAxEventsOnLogonError
# The next line will extract the event parameter
%%lError = @Ole(EventParamsList,IMsTscAxEventsOnLogonError)
# Now do something really cool with the parameter
#Dialog Set,Status1,%%lError
Exit
:IMsTscAxEventsOnFocusReleased
# The next line will extract the event parameter
%%iDirection = @Ole(EventParamsList,IMsTscAxEventsOnFocusReleased)
# Now do something really cool with the parameter
#Dialog Set,Status1,%%iDirection
Exit
:IMsTscAxEventsOnUserNameAcquired
# The next line will extract the event parameter
%%bstrUserName = @Ole(EventParamsList,IMsTscAxEventsOnUserNameAcquired)
# Now do something really cool with the parameter
#Dialog Set,Status1,%%bstrUserName
Exit
|
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Rubes_sw Valued Contributor
Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Jul 23, 2008 8:48 am Post subject: |
|
|
Hi Jonny
Im trying out your example above and i keep getting the following error: any ideaas ?
DateTime: 39652.4069755446
Member: {7584c670-2274-4efb-b00b-d6aaba6d3850}
Function: CreateObject
Errorin: CreateObjectEx
Error: Class not registered
Code: $80040154
Source: Application
Im using windows xp pro sp2
regards
nathan |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 23, 2008 12:15 pm Post subject: |
|
|
You have to install the latest web client for this example to work. Here is the MSDN link to the Web client http://msdn.microsoft.com/en-us/library/aa383541(VS.85).aspx
You have to download and install the activeX control before running this example.
You can also try this...
Find this line
Code: | GadgetX Add,Ole,MSTSCLib,%%classname,0,0,1024,768,{7584c670-2274-4efb-b00b-d6aaba6d3850},NULL |
Replace with this line
Code: | GadgetX Add,Ole,MSTSCLib,%%classname,0,0,1024,768,MsRDP.MsRDP,NULL |
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
K.O. Newbie
Joined: 13 Aug 2008 Posts: 5 Location: ISR
|
Posted: Thu Aug 14, 2008 6:18 am Post subject: Close IE browser window when press X button of MSRdp |
|
|
Hi all
I am a new participant in this forum.
I am trying to intercept MSRdp OCX Events in my
MSVC6.0 program (c++ using IWebbrowser and IHTMLDocument
COM Implementations - Active X).
Can anybody direct me to a demo project (not CS,C# and not VB.
only standard C\C++ code for me) demonstrats how to do
this without the macros of MFC? I try to use it in a "Plug In" so my
Top Level LIB must be Cross Platform (win32 consol application)
complient.
I wish to connect a call back to the OnDisconnected Event of MSRdp ocx.
I am working with win2000 pro. VS6.0 VC++.
Thenks
Ori _________________ go to vc6.0++
c++ is the only cross platform! |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Thu Aug 14, 2008 2:46 pm Post subject: Re: Close IE browser window when press X button of MSRdp |
|
|
K.O. wrote: | Hi all
I am a new participant in this forum.
I am trying to intercept MSRdp OCX Events in my
MSVC6.0 program (c++ using IWebbrowser and IHTMLDocument
COM Implementations - Active X).
Can anybody direct me to a demo project (not CS,C# and not VB.
only standard C\C++ code for me) demonstrats how to do
this without the macros of MFC? I try to use it in a "Plug In" so my
Top Level LIB must be Cross Platform (win32 consol application)
complient.
I wish to connect a call back to the OnDisconnected Event of MSRdp ocx.
I am working with win2000 pro. VS6.0 VC++.
Thenks
Ori |
K.O.,
Welcome to the forum however I think you are at the wrong website. This is a Visual DialogScript only website. It is not a C/C++ website. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
K.O. Newbie
Joined: 13 Aug 2008 Posts: 5 Location: ISR
|
Posted: Thu Aug 14, 2008 3:06 pm Post subject: so can you direct me to a propper site? |
|
|
pls.... _________________ go to vc6.0++
c++ is the only cross platform! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|