The MASM Forum

General => The Campus => Topic started by: shaikkareem on March 06, 2014, 03:09:43 PM

Title: Have a doubt................
Post by: shaikkareem on March 06, 2014, 03:09:43 PM
i noticed that without a file name we can't move, copy, cut, view the properties of that file, delete, etc,. but how windows manages those operations with just selecting the file with mouse cursor and getting the file name for those operations.  you all know that just clicking on desired file and double click it to open and right click it for some operations. ok it is windows thing then how the third party programs were able to receive from windows the information required for their operations from just clicking with mouse on desired file.........?


can any body explain me this , just get a curious about it.................
Title: Re: Have a doubt................
Post by: Mark44 on March 06, 2014, 05:39:34 PM
Quote from: shaikkareem on March 06, 2014, 03:09:43 PM
i noticed that without a file name we can't move, copy, cut, view the properties of that file, delete, etc,. but how windows manages those operations with just selecting the file with mouse cursor and getting the file name for those operations.  you all know that just clicking on desired file and double click it to open and right click it for some operations. ok it is windows thing then how the third party programs were able to receive from windows the information required for their operations from just clicking with mouse on desired file.........?


can any body explain me this , just get a curious about it.................
When you click or double-click the mouse, the event loop that runs all the time captures information about where on the screen the mouse pointer was when the click event was generated. If a file is listed in Windows Explorer or as an icon on the desktop, or whatever, the location of the file name or icon is available to Windows, so it can associated a file with that location. Windows and other operating systems are extendable via an application programming interface (or API), so third-parties can create applications that work like underlying operating system.
Title: Re: Have a doubt................
Post by: hutch-- on March 06, 2014, 06:43:09 PM
It tends to be why the software that runs a computer is called Disk Operating System. Part of its capacity is to provide an interface to such objects as disk files and this has ranged from an ancient DosShell to Winfile and more recently Explorer. They are operating system components that provide an interface to disk files. When you use a Windows API to access a file you are using the location provided by the operating system to find and process that file.
Title: Re: Have a doubt................
Post by: dedndave on March 06, 2014, 09:55:11 PM
in DOS days, you could move a file by using the rename function
it did not make a copy of the file in the process
it would be nice to know if that's possible with win-32   :biggrin:
Title: Re: Have a doubt................
Post by: TWell on March 06, 2014, 10:49:33 PM
Quote from: dedndave on March 06, 2014, 09:55:11 PM
in DOS days, you could move a file by using the rename function
it did not make a copy of the file in the process
it would be nice to know if that's possible with win-32   :biggrin:
MoveFile perhaps ;)
Title: Re: Have a doubt................
Post by: dedndave on March 06, 2014, 11:13:09 PM
thanks Timppa   :t

didn't see that one   :biggrin:
Title: Re: Have a doubt................
Post by: shaikkareem on March 07, 2014, 07:34:36 PM
yeah............ i always wonder how interfaces provided by the core level or something else of windows os to interact with them ........ and i want to knw that is there any way to study about explorer.exe and doing experiments on it(not deeply)...i know that the explorer.exe is the program doing every thing showing icons,folder,etc..., where do i find about this kind of things...............
Title: Re: Have a doubt................
Post by: Vortex on March 08, 2014, 06:43:30 AM
Quote from: dedndave on March 06, 2014, 09:55:11 PM
in DOS days, you could move a file by using the rename function
it did not make a copy of the file in the process
it would be nice to know if that's possible with win-32   :biggrin:

Hi Dave,

It's like UNIX\Linux's mv command.
Title: Re: Have a doubt................
Post by: GoneFishing on March 08, 2014, 10:44:56 AM
Quote from: shaikkareem on March 07, 2014, 07:34:36 PM
yeah............ i always wonder how interfaces provided by the core level or something else of windows os to interact with them ........ and i want to knw that is there any way to study about explorer.exe and doing experiments on it(not deeply)...i know that the explorer.exe is the program doing every thing showing icons,folder,etc..., where do i find about this kind of things...............
go to MSDN and look for Shell programming
Title: Re: Have a doubt................
Post by: TouEnMasm on March 08, 2014, 06:48:10 PM
The explorer is just a window showing what is write in the FAT.
Just made a search on msdn with FAT and you have all that you need.
Title: Re: Have a doubt................
Post by: TWell on March 08, 2014, 07:45:02 PM
Is Shell Extensions what are you looking for ?
Look here (http://msdn.microsoft.com/en-us/library/windows/desktop/cc144067(v=vs.85).aspx)
Title: Re: Have a doubt................
Post by: hutch-- on March 08, 2014, 07:54:11 PM
Dave,

The normal technique in Win32 is if you "move" a file from one directory to another on the same partition, it is just renamed with a different path whereas if you move a file from one partition to another it must be physically copied to the new partition.
Title: Re: Have a doubt................
Post by: dedndave on March 08, 2014, 10:50:38 PM
i guess i haven't played with these methods because i haven't had much need yet   :biggrin:
Title: Re: Have a doubt................
Post by: jj2007 on March 08, 2014, 11:10:31 PM
Quote from: hutch-- on March 08, 2014, 07:54:11 PMThe normal technique in Win32 is if you "move" a file from one directory to another on the same partition, it is just renamed with a different path whereas if you move a file from one partition to another it must be physically copied to the new partition.

Note it's not the coder who does the copying; what Hutch means is that the OS will copy the file, and afterwards delete the old one. Renaming is much faster because it's just changing an entry in the disk directory, without touching the content of the file.

MoveFileEx: (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365240%28v=vs.85%29.aspx)
QuoteWhen moving a file, the destination can be on a different file system or volume. If the destination is on another drive, you must set the MOVEFILE_COPY_ALLOWED flag in dwFlags.

MoveFile: (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365239%28v=vs.85%29.aspx)
QuoteA new file may be on a different file system or drive. A new directory must be on the same drive.
Title: Re: Have a doubt................
Post by: Mark44 on March 09, 2014, 04:31:04 AM
As a bit of historic trivia, back in the DOS 3.x days about 20 years ago, I used to teach a variety of programming courses at a community college. One of the courses I didn't teach was a basic computer literacy course whose goal was to familiarize students with DOS and several common applications such as Word and Excel.

One of the topics in that course was how to rename a disk directory. The basic steps were:

This seemed unbelievably clunky, so I set out to find a better way. After some searching through my DOS and BIOS Function Quick Reference, I found that the low-level DOS (int 21h) function 56h Rename File could be used not only to rename a file, but to rename a directory. My reference didn't document the fact that this function also included directories, but I figured out that it did apply to directories. After all, the only difference between a file and a directory is that a directory has a subdirectory name bit set in the file attributes, and an ordinary file does not.

At the time, there was no command-line support in DOS 3.x to rename a directory, but you could do it using the int 21h DOS interface. Along about DOS 5.0 or so, as I recall, functionality was added to the REN command to work with directories as well as files.

Title: Re: Have a doubt................
Post by: shaikkareem on March 11, 2014, 03:51:55 PM
lots of oops concepts are going in shell programming. implementing interfaces is the key concept in it and lots of more of oop......now the point is masm don't support those(oop) concepts. now to program in shell space what to do...........
Title: Re: Have a doubt................
Post by: dedndave on March 11, 2014, 04:29:18 PM
http://www.drdobbs.com/embedded-systems/object-oriented-programming-in-assembly/184408319 (http://www.drdobbs.com/embedded-systems/object-oriented-programming-in-assembly/184408319)

things can always be done in assembler
the question is - what's the advantage?
it may take some work to get started, but it's do-able   :P
Title: Re: Have a doubt................
Post by: jj2007 on March 11, 2014, 05:26:38 PM
Wow: By Randall Hyde, March 01, 1990 ::)

Check also BiteRider's site (http://objasm32.tripod.com/)
Title: Re: Have a doubt................
Post by: MichaelW on March 11, 2014, 07:21:43 PM
Quote
While there are certain types of programs whose object-oriented implementation is better, examples abound where object-oriented programming systems (OOPS) buy you nothing.
Title: Re: Have a doubt................
Post by: jj2007 on March 11, 2014, 08:49:22 PM
Agreed, Michael. Often, an intelligent use of structures is a much simpler solution.
Title: Re: Have a doubt................
Post by: shaikkareem on March 11, 2014, 09:52:49 PM
i've done programs in c,c++ and java but i found real programming feeling in assembly language programming(masm) better,better......than in them.
but when programming in windows with masm32 they making us to do with their fashion. to do more effective programs i need to take advantages of their library provided by masm32 way. i used masm32 features with not must required  in windows programming style....but now the things are quite against of support of masm32. they mentioning implement interfaces to use their parts... now i wondering how to use masm32 to implement them....studying pages sent links to me above to better understand masm32(assembly language) gottta be full of interesting.........now
Title: Re: Have a doubt................
Post by: Gunther on March 12, 2014, 12:18:28 AM
Jochen,

Quote from: jj2007 on March 11, 2014, 05:26:38 PM
Wow: By Randall Hyde, March 01, 1990 ::)

Check also BiteRider's site (http://objasm32.tripod.com/)

the TASM 4 from 1988 had a lot of object oriented features. Tom Swans book (http://www.amazon.de/Mastering-Turbo-Assembler-Tom-Swan/dp/0672305267) did cover these topics.

Gunther
Title: Re: Have a doubt................
Post by: dedndave on March 12, 2014, 05:02:19 AM
many of the forum members have played with COM, to one degree or another
it's used for many things, including OLE, Direct-X, WMI, and so on
i like to use qWord's "METHOD" macro   :t
it's not that bad   :P