Question

i want to call this.. well as good as ShellExecute(Handle, 'open', 'c:\Windows\notepad.exe', nil, nil, SW_SHOWNORMAL) i can call this without issue from within a method of form1

but i just had a procedure "procedure transformdataset();" that i want to call this in and it does not recognise handle... do i just need to make this procedure a method of form1? how do i do that? is that the solution.

Was it helpful?

Solution

Yes, ShellExecute needs the Window Handle. The most straightforward solution is to pass it in to your method. I find this a bit ugly though so, personally, I'd consider calling ShellExecute when the method returns. If the call is optional (dependent on data), consider returning a status flag from the method that indicates whether the ShellExecute call is required. Either way works, though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top