cancel
Showing results for 
Search instead for 
Did you mean: 

Strange PB datawindow "feature"

Former Member
0 Kudos

Hi All,

One of our customers discovered that by doing a copy Ctrl-C on a DW list, he can do a Paste on notepad and get all the contents of the DW list.

This could be a cool feature, if not for the unexpected problem that the list includes passwords and other information that users are not supposed to see.

I've tried capturing the ctrl-c on pbm_dwnkey, and then calling PeekMessageA, but this is not preventing the copy.

// Prevent Ctrl-C

blob{28}     lblb_Msg

IF KeyDown(KeyShift!) AND KeyDown(KeyC!) THEN

PeekMessageA(lblb_Msg, 0, 256, 264, 1)

    message.processed=TRUE

    message.returnvalue=0

End If

Anybody run into this feature, and any ideas about how to overcome this?

We're on PB12.5.1 Build 4595 (though I don't think it's related to this version, as it also occurs on PB10.5)

Thanks.

Mick Hillel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Here is a link to my blog entry on clearing the clipboard.

You might set up the specific dw to trigger this.

Matt

Former Member
0 Kudos

Seems like the behaviour is PFC feature and not a general PB one.

I've been trying to capture the Ctrl-C in the pbm_dwnkey, but it seems that PFC is grabbing it before I can get my hands on it. I can capture the Ctrl, and I can capture the "c", but when I do both together, it's not triggering the event. So  I haven't been able to clean the Clipboard because of that.

Chris, we have a pfc_m_master inherited menu on the window, and I tried to override the Copy there, that didn't seem to work. What did you have in mind when you said to add a new menu object for that DW .... a popupmenu ? In any case, not sure that it'll work if PFC is getting to the CTRL-C before I do.

Thanks all for your replies.

Mick.

Former Member
0 Kudos

Ahhh ... If you use the PFC Menu (or a descendant there of) - have a look for a Menu Item that has the Crtl+C short-cut assigned. Then in the "extension" layer - over-ride the code to disable it. I suspect that is where your special copy behaviour is coming from.  

Former Member
0 Kudos

Bingo! It was the Copy in the PFC menu feature...

Thanks to everyone for suggestions and help.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mick;

  FYI: Just add a menu or a new menu item to the existing menu object for that DW's dialogue - and assign the Ctrl-C short-cut to it. The new Ctrl+C menu item does not have to have any PowerScript code and will totally block the O/S's Ctrl+C functionality.

HTH

Regards ... Chris

Former Member
0 Kudos

You may want to try KeyDown(KeyControl!) rather than "KeyShift!". Clipboard functions are also available to change/clear the copied stuff.

Former Member
0 Kudos

Sorry, that was a typo (KeyShift!) that I fixed previously, but that did not resolve the issue.

Clearing the Clipboard is an interesting idea, I tried this :

IF KeyDown(KeyControl!) AND KeyDown(KeyC!) Then

     Clipboard("")

END IF

and couldn't get it to work. The clipboard is still copying all the List.

Thanks for your response.

Former Member
0 Kudos

You need to post the function. Also check out EmptyClipboard on user32.dll.