Present a default window layout on startup in Windows 7 - windows-7

I have a Win7 PC in use as part of an experiment control system. The experiment in question uses 4 windows simultaneously, and I would like to find away to open, position and size these 4 windows with a script.
The script would run at start up, so that the newly booted PC presents the user with the four windows as default.
Obviously I can use a batch file in the startup folder to open windows and run applications, but is there a way to specify the layout of these windows?
Many thanks
Si

Assuming that you have access to a scripting language that supports making calls to Windows API functions it shouldn't be too hard. Otherwise I'd suggest writing a small executable in some language (at least any of C++, C# or VB.Net would all work fine) and have that do it.
You could use FindWindow, as described here, to find the windows and MoveWindow, as described here, to move them around.

I use an AutoHotkey script to set up all my environment (around 7 windows in 3 different virtual screens), works pretty well. You can set the location of windows etc.

I can use a batch file to open the apps, then run WiLMA to relocate them

Related

Is it possible to create a binary that can run on both windows and linux

As the title said, with any possible tricks or bugs,can we create a binary file can run both on Linux and Windows without any change?
(The file must be directly created by a compiler)
I know it's nearly impossible,but with some tricky methods,is that possible?

Slow Windows shell performance using _hotkeys folder shortcuts for volume control

I'm trying to create a native, global, focus-independent hotkey control for incrementing/decrementing/mute-toggling system volume on Windows, specifically W10, though I expect whatever solution we find will likely work back through 7 and 8/8.1 as well.
I have found this - How can I mute/unmute my sound from PowerShell - and it works a treat, from within a PowerShell window. Ok, but I need this Type to be persistent and global then?
I then created three files, -.ps1, +.ps1, and 0.ps1, which include the entire type definition from the linked post, and then a one liner each, as follows:
[Audio]::Volume = [Audio]::Volume - .2
[Audio]::Volume = [Audio]::Volume + .2
[Audio]::Mute = [Audio]::Mute -bxor 1
Technically, all that works, but running each one pops open a PS window for 50 milliseconds or so. That's ugly, but maybe unavoidable.
Then I found this, - How to run a PowerShell script without displaying a window? - to use PSRun.exe. Turns out that in no case could I get that to successfully execute any of these scripts. I used shortcuts (.lnk) with arguments and .cmd files, and only got compilation errors.
So I tried this - https://www.faqforge.com/windows/how-to-execute-powershell-scripts-without-pop-up-window/ - using a VBS helper to hide the window. That works too, but I'd rather not use VBS if possible.
I then created a folder, %homedrive%\Users\\AppData\Roaming\Microsoft\Windows\Start Menu_hotkeys, and put one shortcut each to the .ps1 files, and assigned Alt-F6, Alt-F7, and Alt-F8 to the shortcuts.
When I run one of the shortcuts by GUI clicking, it takes about 100 milliseconds for either the .vbs or the .ps1 directly. However, when running either shortcut via hotkey, it takes more than a second!
I imagine there might be two (or more) solutions:
Can I increase the performance of a Windows shell hotkey that runs a shortcut to a script file? I realize that call stack looks silly long for something that seems like it should be so simple of a task.
OR
Can I create a persistent PowerShell window and run scripts into it by use of a global, focus-independent hotkey?
I'd even entertain building a TSR that does nothing but silently awaits hotkeys for volume control, but that seems less "nice" than working this out with PowerShell.
And before you ask, it's not a performance issue from this hardware, I'm running W10x64 on an i7-7700K with 16GB of RAM and a 128GB M.2. Running 40 Firefox tabs and 25 applications gets me to about 20% CPU use and 40% RAM use.
Feel free to slap me around if this question already has a solid, functional answer and my Google-Fu just didn't find it. My searches turned up things from across the last 5 years, but nothing conclusive or properly functional.

Ollydbg 1.10 "Back to user mode" doesn't work

I tried to learn "Lena's reversing for newbies", when some trouble arise.
I start Pixtopian Book with ollyDbg, then try to have MessageBox with message about uregistered version.
Then i switch to OllyDbg, stop program executing and press "Alt+F9" for "Back to user mode" which stop the program after it exit from DLL.
But after this program does not work, it's frozen and does not respond to my actions.
If i turn off "Back to user mode" program normally work.
What's the problem? Can i try to use "Back to user mode" in IDA (uses WinDbg) or some other debugger and How i can do this? Can i repair it function in OllyDbg?
P.S. It's like the program stopped and didn't run after use "ALT+F9".
/Sorry for my English, i'm just learning ;-)/
First of all, Ollydbg is meant for 32 bit platform. It means that it will run only on a 32 bit OS and can only debug 32 bit apps.
In x64 Operating Systems (specifically Windows) there is a feature called compatibility mode that lets you run 32 bit apps. The 32 bit code is either run by emulation or natively (when the hardware itself implements the instruction set and then it is called x86-64).
So, when you try to run Ollydbg in a x64 environment it will run, but you will experience problems like the one you are facing. It occurs because Ollydbg is run in an emulation mode. Being a debugger it needs access to the registers and other system structures, which it is denied. What it can see is a virtual image of the system.
So the solution to the problem is using a Virtual Machine.
You would install a 32 bit OS in it and debug the app using Ollydbg. As far as Virtual Machines are concerned, I would recommend VMWare. You can use either the workstation or player version. The latter is free but does not support snapshots.
Other solutions are Virtual Box, Parallels Workstation and Microsoft Virtual PC.
The disadvantages of them are that Virtual Box does not support hardware breakpoints, Parallels Workstation is no longer supported as of 2014 and moreover there you would get a BSOD if you try to single step through FPU instructions. I have not tested Virtual PC though.
Note : Ollydbg does not supports x64 but its author is working on a x64 version.
I just learned how to update changes to the exe file for ollydby v 2.01e.
suppose I wished to change a jl command to a jmp; do this by clicking the executable modules button, choose the file and right click to view the file. then record the changes and save file. The saved file also has a backup in case something goes wrong.
I just did a thorough learning of the pixtopian file. When I downloaded
that tutorial I get the file pixtopian107.exe only. Since it didn't agree with the tutorial I investigated further. That file is an installation file. It produces a regular pixtopian.exe file which is the file you wish to play with.
I also noticed that in running the file it never enters the main module.
this is because of the TLS callback. right now I am trying to learn how
to overcome this which is how i came to this site in the first place.
I am using ollydbg vs2.01e very effectively.
Another thing, in vs 2.01e I am still trying to save changed data. Until I succeed I am recording the changes in the exe files using hex editor.
From my experience I can tell that this functionality won't work on Windows 7.
On Windows 7 64bit --> Won't work at all.
On Windows 7 32bit --> Will work partially, but only when using option "File>Attach" in OllyDbg.
For me, best solution was to use Windows XP 32bit, then it worked fine.

copy clipboard of linux into windows clip-board in network

I am writing a small tool, that copies clipboard of linux into windows clip-board. Let me take an example, both linux and windows in network connection. I copy something in linux to clip-board, then when I press some keys in windows lets take CTRL+ALT+v what is copied in linux should print in linux.
What I thought is executing some script in linux from windows through ssh connection. That script shall copy the clip-board into some file in windows, then windows shall put the file content into windows clip-board.
My problem is connection with linux from windows and executing the script. How can I achieve this ?
And please share if you have any better idea to do this.
Thanks a lot :).
There is a free, cross-platform, open-source program called Synergy that does exactly what you are describing (and more), and I have tested it with a Windows/Linux connection. You could take a look at the source code and see how the clipboard functions are implemented, or it might fit your needs already.

Windows Explorer Alternate Data Stream Shell Extension

I have some files that use alternate data stream and are not shown on windows explorer. I would like to make a shell extension or a program that runs on background that when I use windows explorer and navigates to a folders that has alternate data streams files, to show this file to windows explorer but with an overlay icon on it.
Is this possible? Is there a sample code to check?
Thanks a lot.
Another, more recent, option, that works with Windows Explorer x64, too, is AlternateStreamExtension. It also provides icon overlays.
You can find it here.
There's already a shell property sheet handler available from Microsoft called StrmExt. Granted, it's not quite what you're looking for, was written for Windows 2000 and Windows XP, and has to be recompiled for 64 bit versions of Explorer, but it includes the C++ source code, which should give you a place to start, at least.
In Windows Vista, two new API functions were introduced to allow easier enumeration of Alternate Data Streams: FindFirstStreamW and FindNextStreamW. These functions work much like the other FindFirstX and FindNextX type functions that have been in Win32 for years.

Resources