Questions tagged [setwindowlong]

20 questions
32
votes
4 answers

Removing window border?

I have a window with a solid border around it. How can I remove the border (all of the non-client area) by using SetWindowLong and GetWindowLong?
Kristina
  • 15,859
  • 29
  • 111
  • 181
24
votes
3 answers

How do I call SetWindowLong() in the 64-bit versions of Windows?

In the header file WinUser.h, there is a part in which the constants of the second parameter of SetWindowLong() are defined. // ... #define GWL_WNDPROC (-4) #define GWL_HINSTANCE (-6) #define GWL_HWNDPARENT (-8) #define GWL_STYLE…
hkBattousai
  • 10,583
  • 18
  • 76
  • 124
14
votes
2 answers

How do I pinvoke to GetWindowLongPtr and SetWindowLongPtr on 32-bit platforms?

I want to P/Invoke to GetWindowLongPtr and SetWindowLongPtr, and I'm seeing conflicting information about them. Some sources say that, on 32-bit platforms, GetWindowLongPtr is just a preprocessor macro that calls GetWindowLong, and GetWindowLongPtr…
Joe White
  • 94,807
  • 60
  • 220
  • 330
3
votes
2 answers

Right click(popup menu) does not work when change diretion of treeview with SetWindowLong Command

When I use SetWindowLong command to change direction of treeview, popupmenu on its node dose not show. Full Code is here : Procedure SetWinControlBiDi(Control: TTreeView); var ExStyle: Longint; begin ExStyle := GetWindowLong(Control.Handle,…
3
votes
1 answer

Transparent Form with Visible Clickable Controls in it

I'm trying to make a mouse transparent form in win8 and winforms, that contains controls that are clickable. I'm able to make the form mouse transparent, using this code int initialStyle = GetWindowLong(this.Handle, -20); SetWindowLong(this.Handle,…
Guy Levin
  • 1,230
  • 1
  • 10
  • 22
3
votes
1 answer

Detect / Hook Window Move/Drag of other external processes

What is the best way to Detect Window Move/Drag of other Processes? In Windows7 64-bit I'm currently investigating Global Hooks from a DLL using C++ & C#. It's a pain as it doesn't want to work properly. I've gotten some success with keyboard and…
ColacX
  • 3,928
  • 6
  • 34
  • 36
2
votes
1 answer

How can I simplify code that modifies Window Styles using SetWindowLong & GetWindowLong?

I'm writing some wrapper functions and classes for the Windows API. A common occurrence I'm starting to come across is modifying Windows Styles. The following is some example code that my adjusts a TextBox's Text Alignment based on the parameter…
FrOzeN
  • 55
  • 3
2
votes
0 answers

SetWindowLong & SetLayeredWindowAttributes doesnt work on different user C#

The goal is I want to change the opacity of some application (target) running on win xp. The situation I logged in win xp as AD (active dir) user account (some-domain\username) most of the target applications are run as local user or another ad…
sickdoctor
  • 85
  • 6
1
vote
0 answers

Question about SetParent API, it doesn't work on Windows 11

Good evening everyone So sorry for my mediocre english I have a question about the SetParent API. When I run the window on Windows 10, it works correctly and contains any program I want But when the program is executed on Windows 11, it does…
1
vote
0 answers

LuaRef Call crash in WNDPROC CALLBACK

Hi guys. I have some overlay with lua support. I need to create some WndProc callbacks, so I hooked WndProc of target window using SetWindowLong and saving old one LRESULT CALLBACK nProc(HWND hWnd, UINT _Msg, WPARAM wP, LPARAM lP) // its new…
Alxspb
  • 35
  • 6
1
vote
2 answers

Removing WS_BORDER and WS_CAPTION from windows styles doesn't work

I created a small app in C# that removes border and caption from window, then it sets size to the user's resolution and centers it. It's a utility for me to use when I want to play games in windowed mode without being annoyed by the borders.…
JStrange
  • 45
  • 2
  • 5
1
vote
1 answer

VB6 SetWindowLong Causing Refresh Issue in Windows 7 64-bit

I am still supporting and old vb6 application that utilizes GetWindowLong and SetWindowLong to remove the ControlBox at runtime depending on a setting. This works great on all 32-bit systems but when it runs on a 64bit system the main window no…
dblwizard
  • 595
  • 7
  • 26
0
votes
2 answers

SetWindowLong is not working on some computers

Edit: More Information I've narrowed it down to certain applications on certain computers. I am trying to launch chrome in a full screen mode on a certain monitor. This works perfectly on most systems I have tested however we have run into a set of…
Timothy Strimple
  • 22,920
  • 6
  • 69
  • 76
0
votes
0 answers

C# Unable to remove scroll bars on external RDP process using SetWindowLong

I am trying to remove the scroll bars from an RDP window that my C# code launches. My code launches mstsc.exe passing the appropriate path the the rdp file. But once it's open, my code needs to remove the horizontal and vertical scroll bars. My…
Ray
  • 4,679
  • 10
  • 46
  • 92
0
votes
0 answers

Advantage of setting window data on WM_CREATE

According to Microsoft's docs, the way to set custom Window data is to pass it through the lpParam argument of CreateWindowEx, retrieve it within the window procedure on WM_CREATE, and then set it using SetWindowLongPtr. I was wondering why you'd…
user13366655
1
2