Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
hi hook under windows is easy,but how to hook under linux.I want to hook messages of a process under linux,could you give me some help?
-kkklko
Posted
Comments
Sergey Alexandrovich Kryukov 2-Sep-13 23:49pm    
Messages? In Linux? What do you mean by that? :-)
—SA
[no name] 3-Sep-13 20:19pm    
This is the 8th time that you have posted and reposted this same exact question. How many more times do you need to ask?

1 solution

Not only it is not in general case possible, but the question makes no sense at all. First of all, even Windows processes may not have any messages; as to Linux, there is no a single concept analogous to Windows "message". Generally, Linux has much smaller and much more distinct kernel then Windows "hybrid" kernel, and UI "messages" is not a part of the kernel.

(Compare:
http://en.wikipedia.org/wiki/Hybrid_kernel[^],
http://en.wikipedia.org/wiki/Linux_kernel[^],
http://en.wikipedia.org/wiki/Monolithic_kernel[^].)

Moreover, the injection of the code into the message processing of another process is a kind of Windows-specific historical nonsense. Historically, Windows emerged as a shell over the DOS "OS", without any support of process isolation. Any process could freely and directly access memory of any other process. Different processes could communicate by sending messages to each other, same very messages designed to organize the even-oriented UI of the single process. Later on, isolated memory spaces for processes was introduces and supported by the protected mode and paging of i386 CPUs (NT, "New Technology"). However, for compatibility reasons, all messages, communications between processes via sending/posting messages and message handling (Windows Function) hooking survived and can actually be used in the newest versions of Windows. Nevertheless, all such techniques used as IPC lie far away from the general line of OS evolution; and I would strongly discourage the use of them. No wonder, Linux is pretty far from this situation.

—SA
 
Share this answer
 
Comments
Ron Beyer 3-Sep-13 0:15am    
+5'd, Linux is a completely different beast than Windows. The biggest reason Linux didn't catch on more was that it was written by developers and for the longest time was a very utilitarian OS, i.e. extremely functional but not user friendly. Its core design is vastly different than Windows.
Sergey Alexandrovich Kryukov 3-Sep-13 0:28am    
Thank you, Ron.
Right, this aspect of Linux history was one of the essential reasons for big differences. Interestingly (but pretty much naturally), UI is one of the most apparent aspects of convergence between Linux and Windows, much more apparent than, say, Mac OS UI which looks weird to both Linux and Windows users.

By the way, finally, it happened: I started to recommend and even install Linux for technically illiterate people. I finally found that it could be easier and safer for them. Three installations for different people worked few years for them, with much less problems some of them had with Windows before...

—SA
Ron Beyer 3-Sep-13 0:31am    
Ubuntu is making great strides in UI usability for Linux, KDE and other window management systems always looked "cheap", finally a big company is putting some time into polishing the front end, I've also been toying more with Linux especially in the HMI/automation world since one of my customers really wants to get around Windows licensing problems with imaging field devices.
Sergey Alexandrovich Kryukov 3-Sep-13 1:25am    
"Cheap" is a very relative term. Simplicity, even resulting from shorter development time, could be beneficial. All UIs have some problems, but situation is generally improving. I think the Unity UI is a step back...
—SA
Ron Beyer 3-Sep-13 1:44am    
I think there are good parts to Unity, but they definitely went the way of Windows 8 even before Windows 8, but behind it all is a usable UI. I do prefer Gnome 3 or Cinnamon to Unity. Cheap may be the wrong term, simple is probably a better one, the relativity comes with the experience of the user, the typical internet surfer/web browser Windows user may find KDE, MATE or some other environments a bit stale (reminiscent of Windows 98 for example), even if they are very usable.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900