PureBasic Forum
http://forums.purebasic.com/english/

Windows Services & Other Stuff
http://forums.purebasic.com/english/viewtopic.php?f=12&t=60881
Page 7 of 7

Author:  RichAlgeni [ Fri May 05, 2017 3:49 am ]
Post subject:  Re: Services, Stuff, and Shellhook

I will do so! Thanks for the heads up!!

Author:  RichAlgeni [ Fri May 05, 2017 4:01 am ]
Post subject:  Re: Services, Stuff, and Shellhook

Looks like the InflateDeflate link is going to your hide video source?

Author:  JHPJHP [ Fri May 05, 2017 4:22 am ]
Post subject:  Re: Services, Stuff, and Shellhook

Hi RichAlgeni,

Sorry about that, there were a few downloads with the links crossed. I have tested and confirmed that all the links now point to the correct package.

Thank you for letting me know.

Author:  RichAlgeni [ Fri May 05, 2017 6:02 pm ]
Post subject:  Re: Services, Stuff, and Shellhook

Thanks!

Author:  JHPJHP [ Thu Nov 30, 2017 12:50 am ]
Post subject:  Re: Services, Stuff & Shellhook

Updated:
- Stuff\ISAPI\...

TESTED:
- Windows 10
- PureBasic 5.61 (x86 / x64)

This example was added after reading this thread: http://www.purebasic.fr/english/viewtopic.php?f=13&t=69661

The Include file was written from scratch, but the example was based on the following work by freak: http://www.purebasic.fr/english/viewtopic.php?f=12&t=57127
freak wrote:
1.Install IIS using Control Panel -> Programs and Features -> Turn Windows features on or off
2.Make sure at least the following components are selected:
◦Internet Information Services
◦Internet Information Services -> Web Management Tools -> IIS Management Console
◦Internet Information Services -> World Wide Web Services Application Development Features -> ISAPI Extensions

3.After the installation, type "localhost" in your browser. A page with the IIS logo should come up if IIS is installed
4.Compile the example to a dll and place it in "C:\inetpub\wwwroot\IsapiExample.dll".
◦Note that you probably cannot compile directly to the folder due to permissions, so compile somewhere else and then move the file there with explorer.
◦If your system is 64bit, you should compile the dll using PBx64. You can run 32bit ISAPI extensions, but it requires extra configuration and I did not actually try that.

5.Open "Internet Information Services (IIS) Manager" from the Startmenu
6.Select the root of the tree on the left and then open "Handler Mappings" in the main view
7.Select the entry named "isapi-dll", right-click and select "Edit..."
8.In the "Executable" field, enter "C:\inetpub\wwwroot\IsapiExample.dll"
9.Click "Request Restrictions" and on the "Access" tab make sure "Execute" is selected. Hit ok on the second dialog.
10.Hit ok on the first dialog. A requester is shown asking if you want to allow the extension. Click "Yes".
◦What this does is create an entry under "ISAPI and CGI restrictions" on the main page. You can also add an entry there manually or later allow/deny an extension there

11.In your browser, open "http://localhost/IsapiExample.dll". If all worked right, you should see the example page generated by the dll.

Author:  swhite [ Thu Nov 30, 2017 7:32 pm ]
Post subject:  Re: Services, Stuff & Shellhook

Hi

I am using a script map (*.dcpay) to load my dll. It does not matter what you use for a script map as long as it is unique. The URL can be anything you want as long as the action ends with the script map. So in my case I called the action dcpayment.dcpay. The important part is the .dcpay which is mapped to my dll in IIS.

In IIS I enabled the script map for the default site under Handler Mappings and I added a new script map and set the access to "execute". I also removed the restriction under mappings that ties the request to a physical file (i.e. dcpayment.dcpay does not need to exist for the request to run).

Perhaps this might be helpful to support multiple ISAPI extensions.

Simon

Author:  RichAlgeni [ Thu Nov 30, 2017 8:57 pm ]
Post subject:  Re: Services, Stuff & Shellhook

To handle multiple extensions, I created an 'isapi' directory, then sub-directories for each handler.

One more note, Windows 2012r2 is so much better at handling changes in IIS Manager. I had numerous issues when I changed handlers in Windows 2008. To the point where IIS would no longer recognize handler mappings, even after I uninstalled and reinstalled IIS.

Author:  JHPJHP [ Sat Dec 08, 2018 2:04 am ]
Post subject:  Re: Windows Services & Other Stuff

Updated:
- Other_Stuff\OtherStuff\SetWindowsHookEx\
-- binaries\SetWindowsHookEx_32.dll, SetWindowsHookEx_64.dll
-- SetWindowsHookEx.pb, SetWindowsHookEx_DLL.pb
- RegisterShellHookWindow.pb

SetWindowsHookEx.pb:
- if the window you want to effect was created from a 32 bit process, execute this file from PureBasic x86
- if the window you want to effect was created from a 64 bit process, execute this file from PureBasic x64

RegisterShellHookWindow.pb:
- not effected by the process the window was created in

While performing cursory tests in Windows 10, I observed the following while opening a variety of applications:
- File Explorer moved to the set position before the Window was visible
- UltraEdit moved to the set position after the Window was visible
- Calculator did not respond to the SetWindowPos Function

NB*: Replace "File Explorer" in the CallWndProc / WindowProc Procedure to suit your needs.

Author:  JHPJHP [ Mon Feb 04, 2019 8:40 pm ]
Post subject:  Re: Windows Services & Other Stuff

Updated:
- various examples and optimizations

Since my last post to this thread there have been numerous additions and improvements to existing examples.

Added Today:
- \Other_Stuff\MonitorStuff\
-- ScaleFactor.pb, SetDpiAwareness.pb, WindowsDpiStuff.pb

NB*: Most of the new additions and improvements can be found peppered throughout my other downloads.

Author:  oreopa [ Sun Mar 31, 2019 8:35 am ]
Post subject:  Re: Windows Services & Other Stuff

Thanx for all your stuff. I found #WM_COPYDATA example very helpful. Appreciate it.

Author:  JHPJHP [ Sun Mar 31, 2019 11:38 pm ]
Post subject:  Re: Windows Services & Other Stuff

Hi oreopa,

Thank you for posting. It is nice to hear the work I have done is appreciated.

NB*: Since my last post to this thread there have been numerous additions and improvements to existing examples.

Author:  RichAlgeni [ Mon Apr 01, 2019 12:25 am ]
Post subject:  Re: Windows Services & Other Stuff

Is that your real picture JHPJHP???

Author:  JHPJHP [ Mon Apr 01, 2019 3:48 pm ]
Post subject:  Re: Windows Services & Other Stuff

Hi RichAlgeni,

Are you referring to my avatar :?:

Image

NB*: Drag & Drop my avatar onto Google image search: https://www.google.com/imghp?hl=EN

Author:  RichAlgeni [ Mon Apr 01, 2019 10:06 pm ]
Post subject:  Re: Windows Services & Other Stuff

:lol:

Page 7 of 7 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/